T08 · Insecure Dependencies
- Location
SKILL.md:77- Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:77-79; related imports inscripts/screen_stocks.py:14-16
Vulnerability Type: Unpinned and integrity-unverified Python dependencies
Risk Level: MediumVulnerable installation command:
bash pip install akshare pandas numpyRelated dependency imports:
python import akshare as ak import pandas as pd import numpy as npTechnical Analysis
The documented installation command retrieves the latest available releases of three third-party packages without exact version constraints, cryptographic hashes, a lockfile, or an explicitly trusted package index. Consequently, the dependency code installed for two different users or at two different times may differ from the code reviewed during this audit.
Python packages can execute package-controlled code during installation and import. The application imports all three dependencies at startup, so a compromised upstream release, compromised package repository, dependency-resolution attack, or malicious transitive dependency could execute arbitrary Python code with the privileges of the user running the screener.
No evidence indicates that the currently named packages are malicious. The vulnerability is the absence of controls ensuring that users install the same reviewed artifacts.
Attack Path
- An attacker compromises a direct or transitive dependency release, its maintainer account, or the package distribution channel.
- The attacker publishes a malicious release under a dependency name accepted by the unrestricted installation command.
- A user follows the documented
pip install akshare pandas numpyinstruction. - Pip resolves and installs the attacker-controlled release because no approved version or artifact hash is enforced.
- The user starts
scripts/screen_stocks.py. - Malicious package initialization or import code executes under the invoking user's account.
...[truncated 639 chars]
- Remediation
View remediation
Remediation Suggestions
- Define exact, reviewed direct and transitive dependency versions in a lockfile generated by a reproducible dependency-management tool.
- Require cryptographic hashes for every distributed artifact, for example through a fully pinned requirements file used with
pip install --require-hashes. - Configure installations to use an explicitly trusted package index or an internally controlled artifact repository.
- Install dependencies in an isolated virtual environment under a non-privileged account; do not recommend administrative or root installation.
- Add automated dependency vulnerability and provenance checks to the release process.
- Review dependency updates before changing pins, regenerate hashes in a controlled environment, and publish the updated lockfile with the project.
- Replace the installation documentation with a controlled command such as:
bash python -m pip install --require-hashes -r requirements.txt
