T08 · Insecure Dependencies
- Location
SKILL.md:10- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 10; repeated inscripts/stock_cli.py, line 12
Vulnerability Type: Unpinned and unverifiable third-party dependency installation
Risk Level: MediumVulnerable code snippets:
SKILL.md, line 10:bash pip install aksharescripts/stock_cli.py, lines 9–13:python try: import akshare as ak except ImportError: print("请先安装: pip install akshare") sys.exit(1)Technical Analysis
The project directs users to install
aksharefrom the currently configured Python package index without specifying a reviewed version, cryptographic hashes, or a trusted index URL. The project also provides no dependency lock file.As a result, the installed package and its transitive dependencies can change after the Skill has been audited. If a future package release, transitive dependency, or configured package index is compromised, attacker-controlled installation or import-time code could execute under the account running the installation. The documentation similarly describes Baostock as a fallback without defining a verified version.
This finding does not establish that AkShare or Baostock is currently malicious. The vulnerability is the project's reliance on mutable, unverified dependency resolution.
Attack Path
- A user follows the documented
pip install akshareinstruction. - pip queries the user's configured package index and resolves the latest compatible AkShare release and transitive dependencies.
- An attacker compromises a future dependency release or controls an index configured with sufficient priority.
- pip downloads and installs the attacker-controlled distribution without project-provided hash verification.
- Malicious build hooks, installation behavior, or module initialization executes under the user's privileges during installation or when
stock_cli.pyimports AkShare.
Impact Assessme
...[truncated 436 chars]
- A user follows the documented
- Remediation
View remediation
Remediation Suggestions
- Create a dependency lock file containing reviewed, exact versions for AkShare and all transitive dependencies.
- Record cryptographic hashes for every permitted distribution and install with:
bash python -m pip install --require-hashes -r requirements.txt - Configure an explicit trusted package index rather than relying on an arbitrary user or environment configuration.
- Review dependency updates before changing the lock file, including package ownership, release provenance, build configuration, and newly introduced transitive dependencies.
- Prefer prebuilt, verified wheels and prohibit unexpected source builds in production environments.
- Run the CLI in a least-privileged virtual environment or isolated container without unnecessary credentials or filesystem access.
- Update both
SKILL.mdand the import-error message inscripts/stock_cli.pyto reference the locked installation procedure. - Apply the same pinning and hash-verification controls if Baostock remains a supported fallback.
