T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:27
- Finding
- Unpinned Third-Party Dependencies Installed from a Mutable Package Index## Vulnerability Details **File Location**: `SKILL.md`, lines 27-31 **Vulnerability Type**: Unverified and unpinned third-party dependency installation **Risk Level**: Medium **Complete Code Snippet**: ```markdown ### 3. Install dependencies ```bash pip3 install tushare pandas --user ``` ``` ### Technical Analysis The installation instructions retrieve the latest available versions of `tushare` and `pandas` from pip's configured package index without version constraints, cryptographic hashes, a lockfile, or integrity verification. The effective dependency code can therefore change after the Skill has been audited. Python package installation may execute package build or installation logic with the invoking user's privileges. Runtime imports also execute package initialization code. Consequently, compromise of a package release, its distribution account, the configured package index, or a transitive dependency could introduce arbitrary code into the Skill's execution path. The direct `pandas` installation also appears unnecessary because `scripts/market.py` does not import it. Although Tushare may resolve pandas transitively when needed, declaring it directly without a reviewed version unnecessarily broadens the explicit dependency surface. This is a supply-chain weakness rather than evidence that the currently named packages are malicious. ### Attack Path 1. An attacker compromises a dependency publisher, package-index account, configured package mirror, or relevant transitive dependency. 2. The attacker publishes a malicious release under a dependency name that the instructions install without a fixed version. 3. A user follows `SKILL.md` and runs `pip3 install tushare pandas --user`. 4. pip resolves the mutable release and installs it without validating a project-provided hash. 5. Malicious package logic executes during installation or when `scripts/market.py` imports Tushare. 6. The payload runs with the p ...[truncated 592 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the free-form installation command with a reviewed, version-pinned requirements file. 2. Pin every direct and transitive dependency to an exact version. 3. Record approved distribution hashes and install with `pip --require-hashes`. 4. Generate and review a lockfile using a dependency-locking tool. 5. Remove `pandas` as a direct installation instruction unless the project directly requires and imports it. 6. Install dependencies inside an isolated virtual environment rather than the user's shared package directory. 7. Regularly scan locked dependencies for known vulnerabilities and review updates before changing approved versions. 8. Use a trusted package index or controlled internal mirror and require TLS certificate validation. Example hardened workflow: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ```
