T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2
Additional Locations:SKILL.md:15-18,demo_project/README.md:7-10
Vulnerability Type: Unpinned and unhashed third-party dependencies
Risk Level: MediumThe project installs dependencies using unrestricted minimum-version constraints:
text xtquant>=1.0.0 pandas>=1.5.0The installation instructions cause these dependencies and their transitive dependencies to be installed and executed:
bash pip install xtquantbash pip install -r ../requirements.txtTechnical Analysis
The
>=constraints allow the package resolver to install any current or future version satisfying the minimum version. No lock file, package hashes, exact versions, or trusted package-index configuration are provided.Python package installation can execute package build logic, while subsequent imports execute installed package initialization code. The implementation of
xtquantis not included in this project, so the audit could not verify the behavior of the code users are instructed to install.This does not establish that the named packages are currently malicious. It creates a supply-chain weakness in which future releases, a compromised publisher account, a compromised package index, or unsafe index precedence could introduce code that was never reviewed with this project.
Attack Path
- An attacker compromises a dependency publisher, distribution channel, or package source used by the installer.
- The attacker publishes a malicious package release with a version satisfying
xtquant>=1.0.0orpandas>=1.5.0. - A user follows the documented installation command without a previously locked environment.
- The resolver selects the attacker-controlled or compromised release.
- Malicious code executes during installation, import, or normal package use with the privileges of the user running Python.
Impact Asses
...[truncated 475 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace minimum-version constraints with exact, reviewed versions, for example:
text xtquant==REVIEWED_VERSION pandas==REVIEWED_VERSION - Generate and commit a reproducible lock file that includes all transitive dependencies.
- Require package hashes during installation, such as through a hash-locked requirements file and
pip install --require-hashes. - Document and enforce the intended trusted package index rather than relying on ambient installer configuration.
- Review package artifacts, release provenance, signatures, and dependency changes before updating locked versions.
- Install dependencies in an isolated virtual environment under a non-privileged account.
- Add automated dependency vulnerability and integrity scanning to the release process.
- Replace minimum-version constraints with exact, reviewed versions, for example:
