subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
run_dir_path = Path(run_dir) run_dir_snapshot = _output_snapshot(list(run_dir_path.glob("*.mp3"))) print(f"attempt {attempt}/{attempts}: {' '.join(cmd)}", file=sys.stderr) result = subprocess.run(cmd, text=True, capture_output=True, cwd=run_dir) stdout = result.stdout if stdout: print(stdout, end="")- Confidence
- 89% confidence
- Finding
- This code executes an external binary and fully user-controlled command arguments via subprocess.run. Although it avoids shell injection by using a list, it still delegates powerful behavior to an attacker-influenced executable/CLI invocation (mmx_bin and command_args), which can read local files, write arbitrary output paths, and trigger networked generation depending on how this wrapper is exposed by the skill.
