subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
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- Confidence
- 79% confidence
- Finding
- The script passes user-controlled text, voice, and rate values into an external program (uvx edge-tts). Although shell injection is avoided by using an argument list, invoking an external tool with unvalidated user input can still create option-confusion, unexpected network activity, or abuse of the helper tool if it has unsafe argument parsing or fetch behavior.
