subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
except ImportError: import subprocess python = str(Path.home() / ".workbuddy/binaries/python/envs/default/bin/python3") subprocess.run([python, "-m", "pip", "install", "ebooklib", "beautifulsoup4", "-q"], check=True) from ebooklib import epub from bs4 import BeautifulSoup- Confidence
- 93% confidence
- Finding
- The script automatically invokes pip through a subprocess when imports fail, causing code from external packages to be fetched and installed at runtime without explicit user approval. This expands the script's behavior beyond EPUB extraction, introduces supply-chain and environment-tampering risk, and may execute package installation logic in the user's environment.
