T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unpinned Third-Party Dependencies Permit Unreviewed Package Resolution<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-2` **Vulnerability Type**: Unpinned and non-reproducible third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```text dataclasses requests ``` The documented installation procedure in `SKILL.md:139-143` executes: ```bash pip install -r requirements.txt ``` ### Technical Analysis Neither dependency is pinned to a reviewed version or protected with a cryptographic hash. Consequently, `pip` resolves whichever compatible artifacts are available from the user's configured package index at installation time. This makes installations non-reproducible and prevents verification that the installed artifacts are the same ones reviewed during the audit. The `dataclasses` package is generally unnecessary when the project runs on Python 3.7 or later because `dataclasses` is included in the standard library. Retaining this external backport unnecessarily expands the dependency and package-installation attack surface. This finding does not establish that either named package is currently malicious. Exploitation requires compromise or unsafe configuration of the package supply chain, such as a compromised package release, a malicious package-index mirror, or dependency resolution through an attacker-controlled index. ### Attack Path 1. A user follows the documented prerequisite and runs `pip install -r requirements.txt`. 2. `pip` queries its configured package index or mirror without enforcing reviewed versions or artifact hashes. 3. An attacker compromises an applicable package release or controls an index or mirror used by the environment. 4. The resolver downloads the attacker-controlled artifact because the requirements accept unrestricted versions. 5. Malicious package build or installation logic executes with the privileges of the account running `pip`. 6. The malicious dependency may subsequently execute again when `scripts/main.py` imports it. ### Impact Assessment Succ ...[truncated 652 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `dataclasses` when the supported runtime is Python 3.7 or later. If older Python versions must remain supported, apply an explicit environment marker and pin a reviewed backport version. 2. Pin `requests` and all transitive dependencies to reviewed versions using a lock file generated by a dependency-management tool such as `pip-tools`. 3. Record SHA-256 hashes for every permitted distribution and install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use an explicitly configured, trusted package index and prevent fallback to untrusted or attacker-controlled extra indexes. 5. Add automated dependency vulnerability and provenance checks to the release process. 6. Periodically regenerate pins in a controlled environment, review changes, run tests, and update hashes rather than allowing unrestricted resolution during installation. ]]>
