T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:22
- Finding
- Unpinned Third-Party Dependencies Permit Supply-Chain Compromise## Vulnerability Details **File Locations**: - `SKILL.md:22-25` - `README.md:21-24` - `优化使用指南.md:29-32` - `manifest.json:12-18` **Vulnerability Type**: Installation of mutable, unverified third-party dependencies **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:22-25`: ```bash ## Installation Dependencies ```bash pip install yfinance pandas numpy matplotlib seaborn plotly ``` ``` `README.md:21-24`: ```bash ### 1. Install Python Dependencies ```bash pip install pandas numpy matplotlib seaborn ``` ``` `优化使用指南.md:29-32`: ```bash ## Install Dependencies ```bash pip install pandas numpy matplotlib seaborn ``` ``` `manifest.json:12-18`: ```json "dependencies": { "python": [ "pandas", "numpy", "matplotlib", "seaborn" ] }, ``` ### Technical Analysis The project instructs users to install third-party Python packages without version constraints, integrity hashes, a lock file, or an explicitly trusted package index. The manifest likewise declares package names without versions. Consequently, installation resolves whichever package versions and transitive dependencies are available from the active pip index at installation time. The reviewed source may therefore execute with dependency code that differs from the versions used during development or security review. Python packages can execute code during installation and expose executable module initialization logic when imported. A compromised upstream release, compromised transitive dependency, or maliciously configured package index could therefore introduce attacker-controlled code into the Skill's execution environment. The documentation also lists `yfinance` and `plotly`, although the reviewed executable implementation does not import them. These unnecessary dependencies increase the available supply-chain attack surface. ### Attack Path 1. An attacker compromises a listed packa ...[truncated 1663 chars]
- Remediation
- ## Remediation Suggestions 1. Create a reviewed dependency lock file containing exact versions for all direct and transitive dependencies. 2. Generate and verify cryptographic hashes for every distribution, then install with hash enforcement, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Pin dependencies to approved versions rather than using unrestricted package names. 4. Explicitly select a trusted package index in deployment documentation and prevent fallback to untrusted indexes. 5. Remove `yfinance` and `plotly` from installation instructions unless corresponding functionality is implemented and required. 6. Run dependency vulnerability and provenance checks in CI whenever the lock file changes. 7. Install and execute the Skill in an isolated virtual environment under a non-privileged account. 8. Keep `manifest.json`, the lock file, and all installation documentation synchronized so every installation path uses the same reviewed versions.
