T08 · Insecure Dependencies
- Location
requirements.txt:2- Finding
Unpinned and Unverified Third-Party Dependencies
- Content
View full analysis
=1.23.0 ezdxf>=1.4.0 openpyxl>=3.1.0 numpy>=1.24.0 matplotlib>=3.7.0 ``` `SKILL.md:105`: ```bash pip install pymupdf ezdxf openpyxl numpy matplotlib ``` `SKILL.md:122`: ```bash pip install rapidocr ``` `SKILL.md:125`: ```bash pip install onnxruntime opencv-python-headless ``` `README.md:30,33,35`: ```bash pip install -r requirements.txt pip install rapidocr pip install onnxruntime opencv-python-headless ``` ### Technical Analysis The project specifies dependencies using unrestricted direct installation commands or lower-bound-only version constraints. It does not provide an exact dependency lock file, package hashes, upper version bounds, or an enforced trusted package index. Consequently, installation can resolve package releases that were not reviewed with this Skill. Python packages may execute package-controlled code during installation, and their modules execute code when imported by the parsers. A compromised future release, compromised package-maintainer account, malicious transitive dependency, or unexpected incompatible release could therefore introduce code into the Agent environment. The affected dependencies are directly imported by the runtime, including PyMuPDF, `ezdxf`, NumPy, and optional OCR packages. This makes dependency integrity part of the runtime trust boundary. ### Attack Path 1. An attacker compromises a dependency release, maintainer account, distribution channel, or transitive dependency. 2. The attacker publishes a malicious version satisfying an open constraint such as `pymupdf>=1.23.0`, or compromises a package installed without any version constraint. 3. An operator follows the documented installation procedure using `pip i ...[truncated 1261 chars]- Remediation
View remediation
ezdxf== openpyxl== numpy== matplotlib== ``` 2. Generate a lock file that includes all transitive dependencies and SHA-256 hashes. Enforce it during installation with: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Pin optional OCR dependencies in dedicated lock files rather than documenting unconstrained `pip install` commands. 4. Configure pip to use an explicitly trusted package index and prevent unintended index fallback or dependency-confusion sources. 5. Review dependency provenance, release signatures where available, vulnerability advisories, and transitive dependency changes before updating locked versions. 6. Remove dependencies that are not required by the implemented runtime to reduce the supply-chain attack surface. 7. Perform installation and document parsing in an isolated, least-privileged environment without unnecessary credentials or host filesystem access. ]]>
