T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Installation
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2; installation instructions also appear inSKILL.md:13-16,README.md:16-19, anddemo_project/README.md:7-10
Vulnerability Type: Unpinned and mutable third-party dependencies
Risk Level: MediumComplete vulnerable code snippet:
text baostock>=0.8.0 pandas>=1.5.0The project also recommends installing the latest available BaoStock release:
bash pip install baostock --upgradeThe demo installation instructions consume the mutable requirements directly:
bash pip install -r ../requirements.txtTechnical Analysis
Both dependencies use open-ended
>=constraints, and the documentation additionally recommends--upgrade. Consequently, installation results depend on whichever package versions are available from the configured Python package index at installation time. The project does not include a lockfile, package hashes, or another integrity mechanism that restricts installation to artifacts reviewed during this audit.Python package installation may execute package build or installation logic. If an upstream package account, release artifact, package index, or dependency chain is compromised, a later malicious release satisfying these constraints could be selected automatically. This is a supply-chain weakness rather than evidence that the currently named packages are malicious.
Attack Path
- An attacker compromises an upstream package publisher, release process, package index, or transitive dependency.
- The attacker publishes a malicious release whose version satisfies
baostock>=0.8.0orpandas>=1.5.0. - A user or AI Agent follows the documented command using
--upgradeor installsrequirements.txt. pipresolves and downloads the attacker-controlled package artifact.- Malicious build, installation, import-time, or runtime code executes in the installation envir ...[truncated 732 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace open-ended constraints with exact versions that have been reviewed and tested, for example:
text baostock==REVIEWED_VERSION pandas==REVIEWED_VERSION - Generate and commit a reproducible lockfile containing cryptographic hashes for all direct and transitive dependencies.
- Install with hash enforcement, such as:
bash pip install --require-hashes -r requirements.lock - Remove
--upgradefrom installation documentation so users do not automatically consume unreviewed future releases. - Configure installations to use a trusted or internally mirrored package index.
- Run dependency installation and the demo in a non-privileged virtual environment or isolated container.
- Add automated dependency vulnerability and provenance checks to CI, and review version updates before modifying the lockfile.
- Replace open-ended constraints with exact versions that have been reviewed and tested, for example:
