T08 · Insecure Dependencies
- Location
SKILL.md:15- Finding
Mutable Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:15-16
Vulnerability Type: Unpinned third-party dependencies and unconditional package upgrades
Risk Level: MediumVulnerable Code
bash pip install baostock --upgradeRelated mutable dependency declarations also appear in:
README.md:18-19demo_project/README.md:7-9requirements.txt:1-2metadata.json:17-21
text baostock>=0.8.0 pandas>=1.5.0json "dependencies": { "python": ">=3.8", "packages": [ "baostock>=0.8.0", "pandas>=1.5.0" ] }Technical Analysis
The installation instructions use
--upgrade, while the dependency manifests specify only minimum versions. Consequently, installation can resolve to future package releases that were not reviewed during this audit. The project provides no exact version pins, lockfile, package hashes, or other integrity verification.The package names are consistent throughout the project, and the audited files contain no evidence of typosquatting, dependency confusion, or a currently malicious dependency. The risk arises from mutable dependency resolution: if a qualifying future release or its distribution channel is compromised, users following the documented installation process could install attacker-controlled code.
Python packages may execute code during installation, and their modules execute code when imported. Both
baostockandpandasare imported by the supplied examples, includingdemo_project/demo.py:1-2.Attack Path
- An attacker compromises a dependency publisher account, package build pipeline, or distribution channel.
- The attacker publishes a malicious release newer than the locally installed version and compatible with the lower-bound constraints.
- A user runs the documented
pip install baostock --upgradecommand or installs fromrequirements.txt. - Pip resolves and installs the malicious qualifying release because no exact version or integrity hash prevents it. ...[truncated 877 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace lower-bound-only constraints with exact versions that have been reviewed and tested:
text baostock==REVIEWED_VERSION pandas==REVIEWED_VERSION -
Remove unconditional
--upgradefrom user-facing installation instructions. Install from a controlled requirements file instead:bash python3 -m pip install --require-hashes -r requirements.lock -
Generate a lockfile containing exact transitive dependency versions and SHA-256 hashes. Commit it to the project and update it only through a reviewed dependency-upgrade process.
-
Verify package provenance and retrieve dependencies exclusively from an approved package index over TLS. In CI, explicitly configure the trusted index rather than inheriting arbitrary user-level pip configuration.
-
Add automated dependency scanning and release review. Test upgrades in an isolated environment before updating the lockfile.
-
Run installation and demonstrations in a virtual environment or restricted container under a non-privileged account. Avoid installing these packages globally or with administrator privileges.
-
Keep dependency declarations synchronized across
requirements.txt,metadata.json,README.md,SKILL.md, and the demo documentation so that all installation paths enforce the same reviewed versions.
-
