T08 · Insecure Dependencies
- Location
SKILL.md:19- Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 19–20
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumComplete Code Snippet:
bash pip install akshare --upgrade pip install pandas numpyTechnical Analysis
The installation instructions fetch and install
akshare,pandas, andnumpywithout pinning reviewed versions or validating package hashes. The--upgradeoption explicitly directs pip to select a newer available release from the configured package index.Consequently, installation is not reproducible: the code installed later may differ from the code available when this Skill was audited. If a package, transitive dependency, configured package index, or package publisher account is compromised, following these instructions could introduce attacker-controlled code. Python packages can execute code during build or installation, and imported packages execute module initialization code at runtime.
This finding concerns unsafe dependency acquisition rather than evidence that the currently named packages are malicious.
Attack Path
- An attacker compromises a named package, one of its transitive dependencies, a publisher account, or a package index trusted by the user's pip configuration.
- The attacker publishes a malicious release that satisfies pip's unconstrained version resolution.
- A user follows the documented installation instructions.
- The
--upgradeor unversioned installation command downloads the attacker-controlled package. - Malicious code executes during package installation, package build, or subsequent import by
scripts/akshare_cli.py.
Impact Assessment
Malicious dependency code would generally execute with the same operating-system privileges as the user running pip or the CLI. Depending on those privileges, it could read or alter accessible files, steal environment variables or credentials, make arbitrary network request ...[truncated 322 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace unconstrained installation commands with a reviewed requirements or lock file containing exact versions for direct and transitive dependencies.
- Record and enforce cryptographic hashes using pip's
--require-hashesoption. - Remove
--upgradefrom routine installation instructions; review dependency upgrades separately before updating the lock file. - Install from an explicitly approved HTTPS package index and prevent fallback to untrusted extra indexes.
- Run dependency vulnerability and provenance checks in CI before releasing updates.
- Install packages in an isolated virtual environment under a non-administrative account.
- A hardened installation pattern is:
bash python -m venv .venv .venv/bin/python -m pip install --require-hashes -r requirements.lockThe lock file should contain reviewed, exact versions and hashes for every resolved package.
