T09 · Insecure Skill Coding Practices
- Location
scripts/run.sh:167- Finding
Arbitrary Command Execution Through Shell Eval Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent text-to-speech purpose, but it needs review because its wrapper can execute injected shell commands and can expose user text and API credentials.
Review this skill before installing. Use it only with chapter text you are comfortable sending to a remote TTS provider, avoid custom --base-url values unless you fully trust the endpoint, prefer setting the API key through the environment, and do not run scripts/run.sh with untrusted arguments until the eval command construction and dependency pinning are fixed.
scripts/run.sh:167Arbitrary Command Execution Through Shell Eval Injection
scripts/synthesize.py:45Unrestricted API Endpoint Permits Credential and Chapter-Content Disclosure
scripts/run.sh:167API Key Exposed Through Process Arguments and Terminal Output
scripts/requirements.txt:1Automatically Installed Unbounded Dependency Creates Supply-Chain Risk
The README states the skill uses the Xiaomi MiMo TTS API but does not clearly warn that chapter contents will be transmitted to a third-party external service for synthesis. If users process novels, drafts, or private documents, they may unknowingly disclose sensitive or copyrighted content to an external provider, creating privacy, compliance, and data-handling risk.
The trigger phrases include very broad terms such as 'TTS合成' and '文字转语音', which can overlap with normal user requests and cause the skill to activate unexpectedly. In a skill that sends user-provided chapter text to an external API, accidental invocation can lead to unintended data processing and external transmission.
The skill advertises behavior that requires shell execution, file reads/writes, and access to an API key from environment variables, but it does not declare any tool scope or permission boundaries. This weakens least-privilege controls and makes it easier for an agent runtime to invoke the skill with broader capabilities than users may expect, increasing the blast radius if the skill is misused or compromised.
The trigger phrases include broad requests like 'TTS合成' and '文字转语音', which can match many generic text-to-speech requests outside the intended chapter-to-audiobook workflow. Overbroad activation can cause the skill to run unexpectedly on unrelated content, leading to unintended file handling or external transmission of user text.
The description says the skill uses Xiaomi MiMo TTS but does not clearly warn that chapter contents will be sent to an external third-party API for processing. Because chapter files may contain sensitive, private, or copyrighted material, users may unknowingly disclose data outside the local environment, making this especially risky for a file-processing skill.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def get_audio_duration(self, filepath: str) -> float:
"""获取音频文件时长(秒)"""
try:
result = subprocess.run(
['afinfo', filepath],
capture_output=True,
text=True
The code feeds attacker-influenced file paths into ffmpeg's concat demuxer with -safe 0, which disables path safety checks and permits arbitrary paths to be referenced from the generated list file. In a skill that processes user-supplied chapter/output paths, this expands the trusted file surface and can enable unintended local file access or processing of attacker-chosen files by ffmpeg, a historically high-risk parser.
f.write(f"file '{safe_path}'\n")
try:
result = subprocess.run(
[
'ffmpeg', '-y', '-f', 'concat', '-safe', '0',
'-i', concat_list_path,
The code sends arbitrary chapter text to Xiaomi's remote MiMo TTS service via chat.completions.create, but this file provides no disclosure, consent flow, or indication that user content leaves the local environment. For a document-to-audio skill, users may supply private manuscripts or sensitive text, so silent third-party transmission creates a real privacy and data-handling risk even if the functionality is intended.
The script's natural-language interface, including help output and prompts, is entirely in Chinese. This forces a specific language on users without offering a locale choice or documenting a justified region-specific constraint.
The script exposes a --base-url parameter even though the skill is described as using the Xiaomi MiMo TTS API. A user or upstream caller can redirect requests to an arbitrary endpoint, causing both chapter contents and the MiMo API key to be sent to an attacker-controlled server; in this skill context, that directly affects sensitive user content and credentials.
该技能声明的核心用途是把章节文件转换为音频,但 check_venv 会自动创建环境并从依赖源安装软件包。对于一个 TTS 转换技能而言,这属于额外的执行环境管理/软件获取能力,而不是清单中明确说明的功能范围。
This Python file contains user-facing natural-language descriptions exclusively in Chinese, including the module docstring and later CLI help/output strings. That creates a locale/language policy concern because the skill forces a specific language experience without documenting user choice or an explicit region-specific justification.
SQP-3 适用于所有文件类型。该文档整体以中文说明技能使用方式并在 L94 仅提供中文触发词,可能构成默认语言约束;同时虽列出英文音色,但未明确技能交互语言是否可由用户选择。
This Python file contains natural-language documentation and runtime messages exclusively in Chinese, such as the module docstring and multiple print statements. Under the policy rule for language/locale, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified.
The module docstrings and printed user-facing messages are written only in Chinese, which imposes a specific language without offering user opt-in or documenting a justified locale restriction. This can violate language/locale policy when the skill is intended for broader use.
The dependency specification uses a lower-bound only constraint (openai>=1.0.0), which permits installation of any future major or minor release. This can introduce supply-chain and stability risk because a later release could contain a vulnerable or incompatible version that gets pulled automatically during deployment.
openai>=1.0.0
When the virtual environment is missing, the script creates a venv and installs dependencies, which modifies the local filesystem and pulls code from external package sources. The script only prints progress messages like '创建虚拟环境...' and does not clearly disclose that it will create files and install packages automatically.