T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unpinned Dependencies Installed Outside an Isolated Environment## Vulnerability Details **File Location**: `SKILL.md`, lines 12–14 **Vulnerability Type**: Unpinned third-party dependencies and unsafe package installation guidance **Risk Level**: Medium **Vulnerable Code Snippet**: ```bash pip3 install yfinance numpy --break-system-packages python3 scripts/analyze.py BTC-USD python3 scripts/analyze.py 0700.HK ``` ### Technical Analysis The installation command retrieves `yfinance`, `numpy`, and their transitive dependencies without specifying approved versions or verifying package hashes. Consequently, the installed code can change between installations without any corresponding change to the reviewed skill package. The `--break-system-packages` option bypasses protections intended to prevent `pip` from modifying an externally managed Python environment. This can cause dependency conflicts or replace packages used by system-level or unrelated Python applications. Although the named packages are legitimate, the documented installation process does not provide version locking, integrity verification, or environment isolation. The project does not contain evidence that it deliberately retrieves and executes a malicious package. The risk arises from the unsafe dependency installation procedure and exposure to compromised releases, dependency substitution, mutable transitive dependencies, and incompatible future versions. ### Attack Path 1. A user follows the quick-start instructions in `SKILL.md`. 2. `pip3` resolves the latest available versions of `yfinance`, `numpy`, and all transitive dependencies from the configured package index. 3. An attacker compromises an upstream package or release, or controls a package index configured in the execution environment. 4. The malicious package executes installation-time or import-time code. 5. When `scripts/analyze.py` imports `yfinance` or `numpy`, attacker-controlled code executes with the privileges of the user running the command. 6. Be ...[truncated 916 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `--break-system-packages` from the installation instructions. 2. Require installation inside a dedicated virtual environment: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ``` 3. Add a lock file or fully pinned `requirements.txt` containing exact versions for direct and transitive dependencies. 4. Record and enforce cryptographic hashes with `--require-hashes`. 5. Review dependency updates before changing locked versions and use automated vulnerability scanning. 6. Install from a trusted, explicitly configured package index and prevent fallback to untrusted indexes. 7. Run the analysis under a non-privileged account with only the filesystem and network access required for market-data retrieval.
