subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd = [sys.executable, os.path.join(SCRIPT_DIR, script_name)] if args: cmd.extend(args) result = subprocess.run( cmd, capture_output=True, text=True, timeout=timeout, encoding="utf-8", errors="replace" )- Confidence
- 84% confidence
- Finding
- The helper _run_script executes whatever script_name and args are provided, and while current call sites use hardcoded values, the helper itself has no allowlist or validation. If this utility were ever reused with attacker-influenced input, it could execute unintended local programs or pass dangerous arguments to project scripts, making the test harness a latent command-execution sink.
