T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:2
- Finding
- Unpinned Third-Party Dependencies Permit Unreviewed Package Execution<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:13-17` - `SKILL.md:102` - `requirements.txt:2-5` - `scripts/validate_quality.py:62-66` **Vulnerability Type**: Dependency versions are constrained only by minimum versions, while the quality validator may dynamically resolve and execute Ruff through `uvx`. **Risk Level**: Medium ### Vulnerable Code `SKILL.md:13-17`: ```yaml install: - kind: uv package: reportlab>=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
- <![CDATA[ ## Remediation Suggestions 1. Replace lower-bound-only constraints with exact, reviewed versions, for example: ```text reportlab==<reviewed-version> pypdfium2==<reviewed-version> pillow==<reviewed-version> ``` 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. ]]>
