subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_script(script: str, values: list[str]) -> int: # Resolve project-facing arguments from the caller's workspace, not from # the installed Skill directory. Bundled resources are located via __file__. return subprocess.run( [sys.executable, str(ROOT / "scripts" / script), *values], cwd=Path.cwd(), text=True, ).returncode- Confidence
- 82% confidence
- Finding
- The helper dispatches to other Python scripts and forwards caller-controlled values into those scripts while setting cwd to the caller's current workspace. While shell injection is avoided, this pattern expands the attack surface because downstream scripts may interpret attacker-supplied paths or content unsafely, and execution occurs in an untrusted project directory where local files influence behavior. In a skill that explicitly operates on arbitrary requirement and project artifacts, this makes the subprocess bridge more security-relevant than a purely internal tool.
