subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print() start = time.time() result = subprocess.run(cmd, cwd=str(Path(orchestrator).parent)) duration = round(time.time() - start) print()- Confidence
- 92% confidence
- Finding
- This code executes a Python script whose path is taken from a JSON block inside CONFIG.md, a user-editable markdown file, without validating that the target stays within the trusted skill directory or matches an expected script. Although subprocess.run is invoked without shell=True, which avoids shell injection, an attacker who can modify CONFIG.md can redirect execution to an arbitrary local Python file and gain code execution when the pipeline is launched. In this skill’s context, which is designed to auto-install and run automation workflows, that trust boundary is especially risky because users are expected to execute it directly.
