subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return pytesseract except Exception: print("Installing tesseract-ocr...") subprocess.run(["apt-get","install","-y","-q", "tesseract-ocr","tesseract-ocr-chi-sim"], check=True) subprocess.run([sys.executable,"-m","pip","install","pytesseract", "--break-system-packages","-q"], check=True)- Confidence
- 94% confidence
- Finding
- The script automatically invokes apt-get to install system packages at runtime when imports fail. This creates a risky side effect for a seemingly simple OCR utility: executing privileged package-management commands can modify the host environment, fail unpredictably, or be abused in sensitive runtime contexts where skills should not perform system-level changes.
