T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unbounded and Unverified Third-Party Dependencies
- Content
View full analysis
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: MediumVulnerable Code:
text backtrader>=1.9.0 matplotlib>=3.0.0The associated installation instructions execute dependency resolution without version or integrity verification:
bash pip install backtrader pip install backtrader[plotting] pip install matplotlibbash pip install -r ../requirements.txtTechnical 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
- An attacker compromises an allowed upstream package release or its distribution channel.
- The attacker publishes a version satisfying
backtrader>=1.9.0ormatplotlib>=3.0.0. - A user follows the documented command
pip install -r ../requirements.txtor one of the unpinned installation commands. - Pip resolves and downloads the compromised version because no exact pin or trusted hash rejects it.
- Malicious package code executes during ...[truncated 789 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace minimum-only constraints with exact versions that have been tested and reviewed:
text backtrader==<reviewed-version> matplotlib==<reviewed-version> - Generate and commit a lock file that includes all transitive dependencies.
- Record cryptographic hashes for every permitted distribution and install with:
bash pip install --require-hashes -r requirements.txt - Use a controlled package index or internal artifact mirror with provenance and access controls.
- Add automated dependency vulnerability, provenance, and license scanning to the release process.
- Update dependencies through reviewed change requests rather than allowing automatic resolution to arbitrary future versions.
- Perform installation in an isolated virtual environment or non-privileged container, and never run pip as root unless strictly necessary.
- Update
SKILL.mdanddemo_project/README.mdso all documented installation commands use the locked, hash-verified dependency file.
- Replace minimum-only constraints with exact versions that have been tested and reviewed:
