T09 · Insecure Skill Coding Practices
- Location
scripts/tencent_tts.py:115- Finding
Unrestricted Output Path Allows Arbitrary File Overwrite
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Tencent Cloud text-to-speech wrapper, but it needs review because it can overwrite arbitrary local files and may print parts of configured credentials.
Install only if you are comfortable sending TTS text to Tencent Cloud and using Tencent Cloud API credentials. Avoid submitting secrets, personal data, or regulated content. Use a dedicated low-privilege Tencent key, do not run the config helper in logs that others can read, and restrict output filenames to a safe audio directory to avoid overwriting local files.
scripts/tencent_tts.py:115Unrestricted Output Path Allows Arbitrary File Overwrite
config/config_template.py:54Credential Fragments Are Exposed in Configuration Status Output
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def generate_env_template(cls) -> str:
"""生成环境变量模板文件内容"""
template = """# 腾讯云语音合成服务环境配置
# 请将本文件保存为 .env 文件,并根据实际情况修改配置值
# ===== 必需配置项 =====
# 腾讯云API密钥 - 请从腾讯云控制台获取
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def generate_env_template(cls) -> str:
"""生成环境变量模板文件内容"""
template = """# 腾讯云语音合成服务环境配置
# 请将本文件保存为 .env 文件,并根据实际情况修改配置值
# ===== 必需配置项 =====
# 腾讯云API密钥 - 请从腾讯云控制台获取
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def generate_env_template(cls) -> str:
"""生成环境变量模板文件内容"""
template = """# 腾讯云语音合成服务环境配置
# 请将本文件保存为 .env 文件,并根据实际情况修改配置值
# ===== 必需配置项 =====
# 腾讯云API密钥 - 请从腾讯云控制台获取
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print(f"✅ 已生成环境变量模板: {env_file_path}")
print("💡 使用方法:")
print(" 1. 复制 .env.template 为 .env")
print(" 2. 编辑 .env 文件,填入实际的API密钥")
print(" 3. 运行: source .env")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print(f"✅ 已生成环境变量模板: {env_file_path}")
print("💡 使用方法:")
print(" 1. 复制 .env.template 为 .env")
print(" 2. 编辑 .env 文件,填入实际的API密钥")
print(" 3. 运行: source .env")
The README shows direct use of the synthesize API but does not clearly warn that input text is transmitted to Tencent Cloud for remote processing. Users may unknowingly send sensitive, regulated, or confidential content to a third-party service, creating privacy, compliance, and data-handling risks. In a TTS skill, this omission is more dangerous because the core function necessarily processes arbitrary user text, which often includes personal or proprietary content.
The skill documentation indicates capabilities involving environment variable access and file writing, but it does not declare any explicit tool scope or permission boundaries. This creates a transparency and least-privilege problem: an agent may invoke the skill without clear constraints, increasing the chance of unintended secret exposure or unauthorized file creation in broader execution contexts.
The trigger language is broad enough to match many common requests related to speech, TTS, or audio file generation, which can cause over-selection of this skill in situations where a more appropriate or safer tool should be used. In an agentic system, overly broad activation conditions can expand the skill's reach and lead to unnecessary use of environment-backed credentials and file output behavior.
SQP-3 applies to all file types and covers language/locale policy violations in natural-language content, including code docstrings and printed strings. This file consistently presents setup guidance in Chinese only and does not provide any opt-in, alternative language, or stated region-specific justification.
This JSON file contains user-facing prompt text exclusively in Chinese across multiple eval cases. Because the skill does not indicate that it is intentionally restricted to Chinese users or provide any opt-in or language-choice mechanism, it may violate language/locale policy requirements.
This code presents its description and runtime user-facing output primarily in Chinese, while the file itself does not state that it is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
This Python file contains user-facing documentation and command-line messages entirely in Chinese, including the module description and runtime prompts. Under the policy rule for language/locale, forcing a specific language without user opt-in is a natural-language policy violation unless the tool is clearly documented as region-specific.
The file's natural-language comments are entirely in Chinese, including usage notes and warnings, without any indication that the skill is region-specific or that users may choose another language. Under the policy for all file types, this can be a language/locale constraint that is not documented as optional or justified.
Using an unpinned dependency range like pytest>=6.0.0 makes builds non-reproducible and can silently pull in vulnerable or breaking future releases. In this file the package is only listed as a test dependency, so the operational risk to the TTS skill is limited, but it still weakens supply-chain hygiene.
# 这些包不是必需的,但可以增强功能
# 测试依赖(用于开发和测试)
pytest>=6.0.0
pytest-cov>=2.0.0
# 开发工具
The manifest does not pin pytest, so it is impossible to determine whether installations will resolve to a version affected by the cited advisory. In this skill the package is only used for testing, which lowers runtime impact, but ambiguous vulnerable-version exposure is still a legitimate supply-chain risk.
An unpinned pytest-cov dependency allows uncontrolled version resolution, which can introduce vulnerable or incompatible releases into CI or development environments. Although this is not part of the core runtime path for the TTS skill, it still creates avoidable supply-chain uncertainty.
# 测试依赖(用于开发和测试)
pytest>=6.0.0
pytest-cov>=2.0.0
# 开发工具
black>=20.0.0
black>=20.0.0 permits installation of arbitrary future versions and also leaves open the possibility of resolving to older vulnerable versions depending on environment state. Because Black has known advisories and is commonly executed on developer machines and CI, an unsafe version could affect local files or disrupt pipelines even though it is a dev tool rather than the TTS runtime itself.
pytest-cov>=2.0.0
# 开发工具
black>=20.0.0
flake8>=3.8.0
mypy>=0.800
Because black is unpinned and has multiple known advisories, the project cannot verify whether a safe version will be installed. Since Black runs in developer and CI contexts and some advisories involve file-write or ReDoS behavior, a vulnerable resolved version could have meaningful impact even if it is not part of the production TTS execution path.
flake8>=3.8.0 is unpinned, so builds may consume unexpected versions with different behavior or future vulnerabilities. This primarily affects development and CI rather than production execution of the TTS skill, but it remains a supply-chain hardening issue.
# 开发工具
black>=20.0.0
flake8>=3.8.0
mypy>=0.800
# 文档生成
mypy>=0.800 leaves dependency resolution open-ended, reducing reproducibility and increasing the chance of pulling in compromised or breaking releases. In this context it is a development-time risk rather than a direct runtime issue for the TTS functionality.
# 开发工具
black>=20.0.0
flake8>=3.8.0
mypy>=0.800
# 文档生成
sphinx>=3.0.0
sphinx>=3.0.0 allows uncontrolled version drift in documentation tooling, which can expose documentation build environments to vulnerable releases or inconsistent behavior. This is not directly exploitable through the TTS runtime, but it is still poor dependency hygiene.
mypy>=0.800
# 文档生成
sphinx>=3.0.0
sphinx-rtd-theme>=0.5.0
# 注意:本skill包主要使用Python标准库
sphinx-rtd-theme>=0.5.0 is unpinned and can pull in unreviewed versions during documentation builds. The risk is limited to developer/docs environments, but it still introduces unnecessary supply-chain variability.
# 文档生成
sphinx>=3.0.0
sphinx-rtd-theme>=0.5.0
# 注意:本skill包主要使用Python标准库
# 如果需要额外功能,可以按需安装上述依赖
This Python file contains user-facing natural-language descriptions and runtime messages in Chinese, starting with the module docstring and continuing throughout the script. Because the skill does not offer any language selection or document that it is intentionally region- or locale-specific, it may violate a language/locale policy requiring user choice.