Back to skill

Security audit

Voice Clone

Security checks for vulnerabilities and agentic risk

Overview

This voice synthesis skill is mostly purpose-aligned, but it has a real command-injection flaw and under-discloses cloud voice-service data handling.

Review before installing. Avoid using this skill with sensitive text or unauthorized voice material, and do not pass untrusted output paths. The publisher should replace the shell-based xdg-open call with a non-shell subprocess call or make playback opt-in, add privacy/consent guidance for cloud providers, and pin dependencies.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
voice-clone.py:229
Finding
Shell Command Injection Through the User-Controlled Output Path<![CDATA[ ## Vulnerability Details **File Location**: `voice-clone.py`, lines 229–250 **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```python if args.engine == "edge": # Map to Edge TTS voice name edge_voices = { "zh-xiaoxiao": "zh-CN-XiaoxiaoNeural", "zh-xiaoyi": "zh-CN-XiaoyiNeural", "zh-yunyang": "zh-CN-YunyangNeural", "zh-yunxi": "zh-CN-YunxiNeural", "en-jenny": "en-US-JennyNeural", "en-aria": "en-US-AriaNeural", "en-guy": "en-US-GuyNeural", "en-sonia": "en-GB-SoniaNeural", } voice = edge_voices.get(args.voice, "zh-CN-XiaoxiaoNeural") output_file = await edge_tts_speak( args.text, voice, args.rate, args.pitch, args.output ) # Other engine branches also pass args.output through as output_file. print(f"\n✅ 语音合成成功!") print(f"📁 输出文件: {output_file}") # Try to play the file if possible. try: os.system(f"xdg-open '{output_file}' >/dev/null 2>&1 &") except: pass ``` The output path originates from the unrestricted command-line option: ```python parser.add_argument( "-o", "--output", type=str, help="输出文件路径" ) ``` ### Technical Analysis The `--output` argument is controlled by the caller and is passed to the selected synthesis function as the output filename. These functions return that value as `output_file`. After synthesis succeeds, the application interpolates `output_file` directly into a command string passed to `os.system()`. `os.system()` invokes a shell. Wrapping the value in single quotes is not sufficient because a filename containing a single quote can terminate the quoted argument and introduce shell metacharacters. The code does not escape or validate the value before shell interpretation. The surrounding `try/except` does not prevent exploitation. `os.system()` generally reports command failure through its numeric return value rather than raising an exception, and any injected command has a ...[truncated 1696 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Do not invoke a shell to open the generated file. Pass arguments directly to the operating system: ```python import subprocess subprocess.Popen( ["xdg-open", output_file], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) ``` Additional hardening should include: 1. Resolve the output path with `Path.resolve()` and, if arbitrary output locations are unnecessary, require it to remain under an approved output directory. 2. Reject output paths containing null bytes and paths targeting unsupported file types. 3. Consider removing automatic playback or making it an explicit opt-in option. 4. Verify that the output is a regular file before opening it. 5. Replace the bare `except` with explicit exception handling and security-relevant error logging. 6. Add regression tests using filenames containing quotes, semicolons, command substitutions, spaces, and newline characters. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:64
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 64–69 **Vulnerability Type**: Unpinned and non-reproducible dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip install edge-tts openai elevenlabs coqui-tts pydantic aiofiles ``` ### Technical Analysis The documented installation command installs third-party packages without version constraints, lock-file resolution, or package hashes. Consequently, every installation may resolve to different package versions and transitive dependency graphs. Python packages and their installation mechanisms execute code within the installation environment. If a dependency account or release is compromised, or if a future release introduces malicious or vulnerable behavior, users following the documentation may install and execute that code with their own privileges. The command also installs all supported backends at once, increasing supply-chain exposure even when a user only needs one TTS provider. Some documented packages are not directly imported by the audited script, further expanding the dependency surface without a demonstrated runtime requirement. No evidence was found that the named packages are intentionally malicious. The finding concerns the unsafe, mutable dependency-resolution process. ### Attack Path 1. A user follows the installation command in `SKILL.md`. 2. `pip` queries the configured package index and resolves the newest compatible versions available at that time. 3. The selected packages and transitive dependencies are downloaded without verification against project-maintained hashes. 4. Package build or installation code executes with the privileges of the user running `pip`. 5. A compromised or malicious release can modify the environment, access user data, or establish additional malicious behavior. ### Impact Assessment A compromised dependency can execute code with the installer’s privileges. Depending on how installation is performed, poten ...[truncated 521 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to a reviewed version. 2. Generate and commit a lock file that includes fully resolved transitive dependencies. 3. Require cryptographic hashes during installation, for example through a hash-locked requirements file and `pip install --require-hashes`. 4. Separate dependencies by backend so users install only the provider integration they need. 5. Remove packages that are not directly or transitively required. 6. Install dependencies inside a dedicated virtual environment rather than into a global or privileged Python environment. 7. Use automated dependency scanning and controlled update reviews. 8. Document supported Python versions and test the locked dependency set before publication. A hardened installation workflow could use: ```bash python -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.lock ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Content
# 尝试播放 (如果可用)
        try:
            os.system(f"xdg-open '{output_file}' >/dev/null 2>&1 &")
        except:
            pass
Confidence
97% confidence
Finding
The code invokes a shell with os.system() and interpolates a user-influenced output_file path into the command. Although the path is wrapped in single quotes, shell metacharacters such as embedded single quotes can break out of quoting and enable command injection, leading to arbitrary command execution when a crafted output path is supplied.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
This skill advertises voice cloning and use of external TTS providers but provides no privacy, consent, retention, or third-party data-handling warnings. Because users may submit sensitive text and reference audio containing biometric voice data, omission of these warnings can lead to unauthorized processing, privacy violations, and compliance issues when data is sent to OpenAI, ElevenLabs, or other providers.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger phrases are broad, generic, and overlap with common conversational requests such as '读给我听' and '朗读', which can cause accidental activation in normal dialogue. In a skill that can invoke external TTS services and process user-provided audio paths, unintended triggering increases the chance of unexpected data processing, API usage, and handling of sensitive text or voice content.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The OpenAI TTS path sends user-provided text to a remote third-party service without an explicit privacy notice or confirmation. If users provide sensitive text, the skill may unintentionally disclose private, regulated, or proprietary information to an external provider.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The ElevenLabs integration transmits user text to an external service without prominently informing the user. In a voice-cloning/TTS context, users may paste sensitive content, making silent third-party disclosure a meaningful privacy and compliance risk.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The skill automatically launches an external application to open the generated audio file. Even aside from the command injection issue above, auto-opening files can trigger unexpected execution paths via desktop handlers, expose local metadata, or create unsafe side effects in automation contexts where the user did not explicitly consent to launching another program.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The natural-language description, help text, and runtime messages are written in Chinese, with no option to choose another interface language. That can violate a language/locale policy when a skill imposes a specific language on all users without opt-in or documented regional justification.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The help text shows `voice-clone -t "Hello" -v en-jenny --engine openai`, implying an Edge-style voice identifier works with the OpenAI engine. In the actual code, OpenAI voices are restricted to `alloy`, `echo`, `fable`, `onyx`, or `shimmer`, and unsupported values like `en-jenny` are silently replaced with `alloy`.

Static analysis

No suspicious patterns detected.