T08 · Insecure Dependencies
- Location
SKILL.md:186- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:186
Additional Location:references/akshare_official_docs.md:35-41
Vulnerability Type: Unpinned and mutable third-party dependencies
Risk Level: MediumComplete Code Snippets
From
SKILL.md:markdown | `import akshare` fails | Not installed | `pip install akshare efinance baostock` |From
references/akshare_official_docs.md:bash # Install pip install akshare # Upgrade to the latest version pip install akshare --upgradeTechnical Analysis
The Skill recommends installing
akshare,efinance, andbaostockdirectly from the package index without exact version constraints, cryptographic hashes, a reviewed lockfile, or an isolated-environment requirement. It also recommends unrestricted upgrades ofakshare.Package versions resolved by these commands can change after the Skill has been reviewed. Consequently, the effective code installed and later imported is not reproducible. A compromised maintainer account, malicious package release, package-index compromise, or unexpected upstream change could introduce arbitrary code into the runtime.
Although the package names do not appear to be deliberate typos in the reviewed material, the installation guidance lacks provenance information for
efinanceandbaostock. The project also provides no dependency manifest against which package identity and integrity can be verified.Attack Path
- The Agent activates the Skill for a stock-analysis request.
- A required import fails because a market-data dependency is unavailable.
- The Agent follows
SKILL.md:186or the AKShare setup reference. pipresolves the mutable latest package releases from its configured index.- An attacker-controlled or compromised release is downloaded and installed.
- Package installation hooks or subsequent imports execute attacker-supplied Python code with the privileges of the Agent process.
- That code can access resou ...[truncated 697 chars]
- Remediation
View remediation
Remediation Suggestions
-
Add a reviewed dependency manifest with exact versions, such as:
text akshare==REVIEWED_VERSION --hash=sha256:REVIEWED_HASH efinance==REVIEWED_VERSION --hash=sha256:REVIEWED_HASH baostock==REVIEWED_VERSION --hash=sha256:REVIEWED_HASH -
Generate and commit a lockfile containing hashes for direct and transitive dependencies.
-
Replace direct
pip installexamples with hash-enforced installation:bash python -m pip install --require-hashes -r requirements.lock -
Remove
pip install akshare --upgrade; upgrades should occur only through a reviewed dependency-update process. -
Document the official package project and repository for every dependency so users can verify provenance.
-
Install dependencies in a dedicated virtual environment or disposable container rather than the Agent's global environment.
-
Run package installation and market-data processing as an unprivileged user with restricted filesystem and network access.
-
Scan dependency releases and transitive dependencies before updating the lockfile.
-
Include the referenced
scripts/implementation in the reviewed artifact so its dependency use and runtime behavior can be verified.
-
