T08 · Insecure Dependencies
- Location
requirements.txt:2- Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Execution
- Content
View full analysis
=4.0 - kind: uv package: pyyaml>=6.0 ``` `SKILL.md:102`: ```bash pip install -r requirements.txt ``` `requirements.txt:2-5`: ```text reportlab>=4.0 # Optional: only needed to also emit a PNG preview montage (scripts/render_pdf.py --png) pypdfium2>=4.30 pillow>=10.0 ``` `scripts/validate_quality.py:62-66`: ```python if shutil.which("uvx"): run(["uvx", "ruff", "check", "."]) return run([sys.executable, "-m", "ruff", "check", "."]) ``` ### Technical Analysis The project specifies lower version bounds without upper bounds, exact version pins, a lockfile, or package hashes. Consequently, future releases satisfying these constraints may be installed without having been reviewed with the audited source code. The validation script also invokes `uvx ruff` when `ruff` is not installed locally. Unless separately constrained by the environment, this can resolve and execute a package version that is not declared or locked by the project. No evidence was found that the currently named dependencies are malicious, typo-squatted, or retrieved from an explicitly unsafe source. The risk arises from permitting mutable, unreviewed third-party releases to enter executable installation and runtime paths. ### Attack Path 1. An attacker compromises the publishing account, build pipeline, or distribution infrastructure of an allowed dependency, or causes a malicious future release to be published under the expected package name. 2. The malicious release retains a version satisfying a constraint such as `reportlab>=4.0`, `pypdfium2 ...[truncated 1264 chars]- Remediation
View remediation
pypdfium2== pillow== ``` 2. Generate and commit a dependency lockfile that includes transitive dependencies and cryptographic hashes. 3. Install dependencies using hash verification, such as: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 4. Pin Ruff as a development dependency and invoke the locked environment instead of allowing `uvx ruff` to resolve an unspecified release dynamically. 5. Keep the dependency declarations in `SKILL.md`, `requirements.txt`, and the lockfile synchronized so all installation paths use the same reviewed versions. 6. Use automated dependency scanning and controlled update pull requests. Review release notes and regenerate hashes before accepting upgrades. 7. In CI and other sensitive environments, restrict outbound package access to an approved registry mirror containing vetted artifacts. ]]>
