subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f"\n Installing: {', '.join(to_install)} ...\n") cmd = [sys.executable, "-m", "pip", "install"] + to_install + ["--break-system-packages"] result = subprocess.run(cmd) if result.returncode == 0: print("\n ✅ Installation complete. Re-run check_env.py to verify.") else:- Confidence
- 88% confidence
- Finding
- The --fix path performs a real package installation by invoking pip and modifying the Python environment. Although the command is built as an argument list rather than a shell string, it still causes system/environment changes without confirmation and may install unpinned packages from configured package indexes, which is risky in automated or privileged contexts.
