T08 · Insecure Dependencies
- Location
scripts/install_ocr_deps.sh:49- Finding
Unpinned Python Dependencies Installed with Root Privileges
- Content
View full analysis
=3.0.0 pdfplumber>=0.7.0 pdf2image>=1.16.0 pytesseract>=0.3.10 Pillow>=9.0.0 opencv-python-headless>=4.5.0 ``` ### Technical Analysis The installation script refuses to run unless it has root privileges and subsequently invokes `pip` within that privileged process. The requested Python packages are not pinned to exact reviewed versions, and no package hashes or lock file are used. The dependency constraints in `requirements.txt` also allow any future version equal to or newer than the specified minimum. Python package installation may execute package build hooks and other installation-time code. Running this process as root means such code receives unrestricted system privileges. Because dependency resolution is mutable, the code ultimately installed can change after the Skill has been reviewed. Root access is reasonably necessary for the `yum` system-package operation, but it is not necessary for Python dependencies. Combining both operations in one root-only installer exceeds the minimum privileges required for the Skill's declared PDF and OCR functionality. ### Attack Path 1. A user follows the project documentation and executes `sudo ./scripts/install_ocr_deps.sh`. 2. The script verifies that it is running as root. 3. The unqualified `pip` command contacts its configured package index and resolves the latest packages satisfying the mutable constraints. 4. An attacker compromises a dependency release ...[truncated 1177 chars]- Remediation
View remediation
