T08 · Insecure Dependencies
- Location
scripts/query_akshare.py:394- Finding
Unpinned Runtime Dependency Installation Creates a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
scripts/query_akshare.py:394-399; related instruction inSKILL.md:34
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: MediumVulnerable Code
scripts/query_akshare.py:394-399:python def load_akshare_module() -> Any: try: return importlib.import_module("akshare") except ModuleNotFoundError as exc: raise SkillError("missing_dependency", "Python package 'akshare' is not installed.", {"install": "python -m pip install akshare --upgrade"}) from excRelated instruction in
SKILL.md:34:markdown - Treat missing `akshare` as an environment issue and relay the install command from the error payload.Technical Analysis
The error payload recommends installing
aksharewithpython -m pip install akshare --upgrade. This command does not constrain the package to a reviewed version and does not verify package hashes. The--upgradeoption may also replace an existing, previously reviewed installation with the latest available release.The project imports both
akshareandpandas, but it supplies no version-pinned dependency manifest, lockfile, or hash-verification policy. Consequently, the code executed after installation can vary over time without any modification to this project. A compromised upstream release, malicious transitive dependency, or unexpectedly incompatible update could execute code with the permissions of the user running the installation or invoking the Skill.The implementation does not itself download and execute a remote script, and no malicious package is proven to exist. The confirmed defect is the unsafe and non-reproducible dependency-installation guidance, which exposes the deployment process to supply-chain compromise.
Attack Path
- The Skill is executed in an environment where
akshareis missing. importlib.import_module("akshare")raises `Mod ...[truncated 1253 chars]
- The Skill is executed in an environment where
- Remediation
View remediation
Remediation Suggestions
-
Add a reviewed dependency manifest covering
akshare,pandas, and required transitive packages. -
Pin every dependency to an exact version rather than installing the latest available release.
-
Generate a lockfile and verify package artifacts with cryptographic hashes. For pip-based deployment, use a command such as:
bash python -m pip install --require-hashes -r requirements.txt -
Remove
--upgradefrom all runtime installation guidance. -
Install dependencies during a controlled build or deployment phase rather than instructing an Agent or end user to install packages dynamically.
-
Use an isolated virtual environment or container with least-privilege permissions.
-
Review and update pinned versions through a controlled dependency-update process that includes vulnerability scanning and regression testing.
-
Change the missing-dependency response to reference the project's verified installation procedure instead of emitting an unconstrained pip command.
-
