subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def install(): cmd = f"& '{PY}' -m pip install {' '.join(DEPS)}" result = subprocess.run([POWERSHELL, "-Command", cmd], capture_output=True, text=True, timeout=120) print(result.stdout) if result.returncode != 0: print(f"错误: {result.stderr}")- Confidence
- 95% confidence
- Finding
- The script builds a PowerShell command string using values from config.json and passes it to PowerShell with -Command. If python_path or powershell is tampered with, this becomes command injection in a privileged cross-boundary installer context, allowing arbitrary command execution on the Windows host.
