subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def ensure_deps(): if importlib.util.find_spec("pypdf") is None: import subprocess subprocess.check_call( [sys.executable, "-m", "pip", "install", "--break-system-packages", "-q", "pypdf"] )- Confidence
- 94% confidence
- Finding
- The script invokes pip at runtime to install a dependency, causing code from an external package index to be fetched and executed during normal use. This expands the trust boundary from local PDF inspection to network/package-supply-chain execution, and the use of --break-system-packages further increases system risk by modifying the interpreter environment unexpectedly.
