subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if script_path and os.path.exists(script_path): print(f"🚀 执行分析脚本: {script_path}") try: result = subprocess.run( [sys.executable, script_path], capture_output=True, text=True,- Confidence
- 97% confidence
- Finding
- The orchestrator executes a Python script from a caller-supplied path with subprocess.run(), which enables arbitrary code execution if an attacker can influence script_path or the generated script artifact. Using a list avoids shell injection, but it does not mitigate the core risk of executing untrusted code.
