T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Unbounded and Unverified Third-Party Dependencies## Vulnerability Details **File Location**: `requirements.txt:1-2` **Additional Locations**: `SKILL.md:18-22`, `demo_project/README.md:7-10` **Vulnerability Type**: Supply-chain exposure through unbounded dependencies **Risk Level**: Medium **Vulnerable Code**: ```text backtrader>=1.9.0 matplotlib>=3.0.0 ``` The associated installation instructions execute dependency resolution without version or integrity verification: ```bash pip install backtrader pip install backtrader[plotting] pip install matplotlib ``` ```bash pip install -r ../requirements.txt ``` ### Technical Analysis Both dependencies specify only minimum versions and do not impose upper bounds, exact version pins, lock-file constraints, or cryptographic hashes. Consequently, each installation may resolve to a different package release, including releases published after this audit. The reviewed package names and referenced upstream URLs appear legitimate; there is no evidence of typosquatting, dependency confusion, or an actively malicious release in the audited files. The vulnerability is the absence of controls ensuring that users install the same reviewed dependency artifacts. Python packages can execute package-controlled code during installation or when imported. If an upstream account, package repository, distribution artifact, or future dependency release is compromised, following the documented installation process could execute attacker-controlled code. ### Attack Path 1. An attacker compromises an allowed upstream package release or its distribution channel. 2. The attacker publishes a version satisfying `backtrader>=1.9.0` or `matplotlib>=3.0.0`. 3. A user follows the documented command `pip install -r ../requirements.txt` or one of the unpinned installation commands. 4. Pip resolves and downloads the compromised version because no exact pin or trusted hash rejects it. 5. Malicious package code executes during ...[truncated 789 chars]
- Remediation
- ## Remediation Suggestions 1. Replace minimum-only constraints with exact versions that have been tested and reviewed: ```text backtrader==<reviewed-version> matplotlib==<reviewed-version> ``` 2. Generate and commit a lock file that includes all transitive dependencies. 3. Record cryptographic hashes for every permitted distribution and install with: ```bash pip install --require-hashes -r requirements.txt ``` 4. Use a controlled package index or internal artifact mirror with provenance and access controls. 5. Add automated dependency vulnerability, provenance, and license scanning to the release process. 6. Update dependencies through reviewed change requests rather than allowing automatic resolution to arbitrary future versions. 7. Perform installation in an isolated virtual environment or non-privileged container, and never run pip as root unless strictly necessary. 8. Update `SKILL.md` and `demo_project/README.md` so all documented installation commands use the locked, hash-verified dependency file.
