T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unbounded Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2,README.md:19,SKILL.md:18,SKILL.md:258,demo_project/README.md:9
Vulnerability Type: Unpinned and automatically upgraded third-party dependencies
Risk Level: MediumVulnerable Code
requirements.txt:1-2text akshare>=1.0.0 pandas>=1.5.0README.md:19andSKILL.md:18bash pip install akshare --upgradeSKILL.md:258python import mplfinance as mpf # pip install mplfinancedemo_project/README.md:9bash pip install -r ../requirements.txtTechnical Analysis
The dependency constraints specify only minimum versions, allowing pip to install any later release of
akshareorpandas. The documented--upgradecommand explicitly requests the newest available AKShare release, and the optionalmplfinanceinstallation instruction does not specify a reviewed version.Python packages and their transitive dependencies can execute code during build and installation processes and when imported at runtime. Because dependency versions and artifact hashes are not fixed, the code ultimately installed can differ from what was reviewed. A compromised upstream account, malicious package release, compromised transitive dependency, or package-index incident could therefore introduce attacker-controlled code into the environment.
This is a supply-chain weakness rather than evidence that the currently named packages are malicious.
Attack Path
- An attacker compromises an upstream package, one of its transitive dependencies, or its package-distribution account.
- The attacker publishes a malicious version that still satisfies the lower-bound constraints, or publishes it as the newest version selected by
--upgrade. - A user follows the documented installation instructions or installs
requirements.txt. - Pip resolves and downloads the attacker-controlled release because n ...[truncated 927 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace minimum-version constraints with exact, reviewed versions:
text akshare==<reviewed-version> pandas==<reviewed-version> mplfinance==<reviewed-version> - Generate a lock file that includes all transitive dependencies rather than pinning only direct dependencies.
- Record and enforce package hashes, for example by using:
bash python -m pip install --require-hashes -r requirements.txt - Remove
--upgradefrom routine installation instructions. Perform upgrades only through a controlled dependency-review process. - Install dependencies from the official package index or an authenticated internal mirror with provenance and integrity controls.
- Scan proposed dependency updates for known vulnerabilities and review unexpected changes to transitive dependencies.
- Perform installation and execution in an isolated virtual environment or container under a non-privileged account.
- Keep build environments free of unnecessary credentials and restrict outbound network access where operationally feasible.
- Replace minimum-version constraints with exact, reviewed versions:
