subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# ═══════════════════════════════════════════════════════════════════════════ def run_cmd(command: list[str], timeout: int = 120) -> subprocess.CompletedProcess: return subprocess.run(command, cwd=str(WORKSPACE), capture_output=True, text=True, timeout=timeout)- Confidence
- 87% confidence
- Finding
- The code executes commands from configuration via subprocess.run. Although validate_command adds some constraints, it still permits arbitrary relative Python scripts to be launched from the workspace, so a tampered task-suite or workspace can cause execution of unintended code under the evaluator's privileges.
