subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return pdfmuse except ImportError: print("pdfmuse not found -- installing (one-time)...", file=sys.stderr) subprocess.run([sys.executable, "-m", "pip", "install", "-q", "pdfmuse"], check=True) import pdfmuse # noqa: F401 return pdfmuse- Confidence
- 96% confidence
- Finding
- The code invokes pip at runtime to install a dependency, which introduces unexpected network access and code execution into a file-reading helper. Even though the command is not shell-injected, it still trusts external package indexes and executes downloaded package installation logic, expanding the attack surface beyond the skill's stated purpose.
