T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:10
- Finding
- Unpinned Third-Party Dependency Creates Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, line 10 **Related Execution Point**: `scripts/stock_cli.py`, line 10 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash uv pip install akshare ``` The installed package is subsequently imported by the CLI: ```python try: import akshare as ak except ImportError: print("Please install first: pip install akshare") sys.exit(1) ``` ### Technical Analysis The documentation identifies AkShare version 1.18.48, but its installation command does not pin that version or verify the package artifact with a cryptographic hash. The command therefore installs whichever release the package index resolves at installation time, which may differ from the version considered when this Skill was authored or audited. Python executes package initialization code when `akshare` is imported. As a result, compromise of the package, its publishing account, the package index, or the dependency-resolution path could cause unreviewed code to run locally. An unintended future release could also introduce security regressions or incompatible behavior. This is a supply-chain weakness rather than evidence that the current AkShare package is malicious. ### Attack Path 1. An attacker compromises the upstream package, its publisher account, or a package source used by the installer. 2. The attacker publishes a malicious release under the expected package name. 3. A user follows the unpinned `uv pip install akshare` instruction. 4. The resolver downloads and installs the attacker-controlled release. 5. The user invokes `scripts/stock_cli.py`. 6. Python imports `akshare`, executing its package initialization code. 7. Malicious code runs with the same operating-system identity and permissions as the user or Agent running the Skill. ### Impact Assessment Successful exploitation could permit arbitrary Python code execution within the invoking process's privilege boundar ...[truncated 441 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to the reviewed version: ```bash uv pip install "akshare==1.18.48" ``` 2. Record the complete transitive dependency graph in a committed `uv.lock` file or equivalent lockfile. 3. Verify package artifacts with cryptographic hashes. Where supported, use a hash-locked requirements file and enforce hash checking during installation. 4. Install only from an explicitly configured, trusted package index over TLS. 5. Run dependency vulnerability and provenance checks in CI. 6. Review and deliberately update the lockfile when upgrading rather than resolving the newest release during normal Skill execution. 7. Execute the CLI under a least-privileged account or sandbox with only the filesystem and network access required for market-data retrieval.
