subprocess module call
- Category
- Dangerous Code Execution
- Confidence
- 95% confidence
- Finding
The script automatically invokes pip at runtime to install Pillow if it is missing, which executes an external package manager operation inside the agent context. Even though the package name is fixed, this still expands the attack surface to package-index compromise, dependency confusion via custom pip configuration, or unsafe execution in restricted environments, and it violates the principle of keeping dependencies immutable at runtime.
- Content
python import subprocess print("Installing Pillow (needed to render text cards)...", file=sys.stderr) try: subprocess.check_call([sys.executable, "-m", "pip", "install", "Pillow", "-q"]) except subprocess.CalledProcessError as e: print(f" [ERROR] cannot render text cards without Pillow ({e}). On " "Debian/Ubuntu or Homebrew Python this is usually PEP 668 — try "
