T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:186
- Finding
- Unpinned Dependencies and Incorrect Installation of the Python sqlite3 Standard-Library Module## Vulnerability Details **File Location**: `SKILL.md`, lines 186-190 **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and package-name confusion **Risk Level**: Medium ### Vulnerable Code ```bash pip install requests pip install sqlite3 pip install pandas pip install akshare # Chinese stock data library ``` ### Technical Analysis The installation instructions retrieve third-party packages without version constraints, integrity hashes, or a lock file. Consequently, the code installed by users can change independently of the reviewed Skill package. The instructions also tell users to run `pip install sqlite3`. Python already provides `sqlite3` as a standard-library module, so it should not be installed from a package registry. Resolving a separately published package with the same name creates a package-confusion risk: users may install unrelated or malicious registry content under the mistaken belief that it is the standard Python module. Python packages may execute build or installation logic during installation. A compromised dependency release, malicious same-named package, or compromised configured package index could therefore execute code before the Skill itself runs. No evidence was found that the project intentionally publishes or controls a malicious dependency. This finding concerns the unsafe dependency-installation procedure. ### Attack Path 1. A user follows the installation commands in `SKILL.md`. 2. `pip` resolves packages from PyPI or another package index configured in the user environment. 3. Because no exact versions or hashes are specified, `pip` accepts whichever compatible releases the index currently serves. 4. For `sqlite3`, the resolver may retrieve a third-party distribution rather than use Python’s built-in module. 5. A malicious or compromised distribution executes installation hooks or malicious runtime code. 6. That code runs with the privileges of the user performing the installation. ### Impa ...[truncated 632 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the invalid registry installation instruction: ```bash # Do not run: pip install sqlite3 ``` Use Python’s standard-library `sqlite3` module and document that a Python build with SQLite support is required. 2. Create a reviewed dependency manifest containing exact versions: ```text requests==REVIEWED_VERSION pandas==REVIEWED_VERSION akshare==REVIEWED_VERSION ``` 3. Generate and verify cryptographic hashes for every direct and transitive dependency, then require them during installation: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Commit a lock file produced by a dependency-locking tool and update it only through a documented review process. 5. Recommend installation inside an isolated virtual environment rather than a global or administrative Python environment: ```bash python -m venv .venv .venv\Scripts\python -m pip install --require-hashes -r requirements.txt ``` 6. Document the trusted package index explicitly and discourage unreviewed mirrors or extra package indexes. 7. Add automated dependency scanning and periodic review for known vulnerabilities, unexpected ownership changes, and compromised releases.
