T08 · Insecure Dependencies
- Location
scripts/tts_and_send.py:165- Finding
Unpinned Runtime Execution of the edge-tts Package
- Content
View full analysis
Vulnerability Details
File Location:
scripts/tts_and_send.py, lines 165-178
Vulnerability Type: Unpinned third-party package resolution and execution
Risk Level: MediumVulnerable Code
python def generate_tts(text: str, output_path: str, voice: str = "zh-CN-YunjianNeural", rate: str = "-10%") -> bool: """用 edge-tts 生成 TTS""" try: cmd = [ "uvx", "edge-tts", "-t", text, "-v", voice, f"--rate={rate}", "--write-media", output_path ] result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) if result.returncode != 0: print(f"TTS 生成失败: {result.stderr}") return False return True except Exception as e: print(f"TTS 生成异常: {e}") return FalseTechnical Analysis
The script invokes
edge-ttsthroughuvxwithout specifying a package version or verifying package integrity. Depending on the local cache anduvxconfiguration, this may cause a mutable package release to be resolved and installed from a third-party package registry at runtime.This behavior creates a supply-chain trust boundary that is not fixed at audit or deployment time. A compromised package release, registry account, dependency, package index, or configured package source could cause unreviewed Python code to execute when the TTS function is invoked.
The use of a subprocess argument list rather than
shell=Trueprevents direct shell injection throughtext,voice, orrate; therefore, the issue is not command injection. The risk arises from executing an unpinned package whose effective implementation can change independently of the audited Skill.Attack Path
- An attacker compromises the
edge-ttsdistribution, one of its dependencies, its publisher account, or a package source trusted byuvx. - The attacker publishes a malicio ...[truncated 1357 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
-
Pin
edge-ttsto a reviewed, exact version rather than invoking an unconstrained package name:python cmd = [ "uvx", "--from", "edge-tts==REVIEWED_VERSION", "edge-tts", "-t", text, "-v", voice, f"--rate={rate}", "--write-media", output_path ] -
Prefer installing dependencies during a controlled build or deployment stage instead of resolving them during each Skill execution.
-
Maintain a lock file containing exact transitive dependency versions and cryptographic hashes. Enforce hash verification during installation.
-
Configure package installation to use an explicitly trusted index, and prevent user-controlled environment variables or configuration files from silently redirecting resolution to an untrusted package source.
-
Execute the TTS component in a restricted environment with:
- Minimal filesystem access.
- No access to Feishu credentials unless required.
- Restricted outbound network access.
- A dedicated low-privilege operating-system identity or sandbox.
-
Document that
edge-ttsis a network-backed TTS service and that supplied text may be transmitted to an external provider. Users should not submit sensitive text unless that processing is authorized. -
Periodically review and deliberately update the pinned version after checking its source, release provenance, dependency changes, and published security advisories.
-
