subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f"[FAIL] Cannot import ur_rtde: {e}") print("\nTrying to install...") import subprocess subprocess.check_call([sys.executable, "-m", "pip", "install", "ur_rtde"])- Confidence
- 90% confidence
- Finding
- The script automatically invokes pip to install a package at runtime when the import fails. Installing dependencies during execution is risky because it performs network access and executes package installation logic in the current environment, which can lead to supply-chain compromise, unexpected environment modification, or privilege-related side effects if run in a sensitive context.
