subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return {"module_id": mod["id"], "status": "error", "error": f"脚本不存在: {script}"} print(f"\n>>> 运行模块 [{mod['id']}] {mod['name']}") try: r = subprocess.run([PY, script], cwd=script_dir, capture_output=True, text=True, timeout=300) except Exception as e: return {"module_id": mod["id"], "status": "error", "error": str(e)}- Confidence
- 91% confidence
- Finding
- The code executes a Python script path taken from the registry without any trust boundary checks, allowlisting, or path containment validation. Although it avoids shell injection by using an argument list, a malicious or tampered suite_registry.json can cause arbitrary local Python code execution, which is a real security risk in an evaluation harness that runs modules automatically.
