T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:7
- Finding
- Unpinned Third-Party Dependencies Installed from a Mutable Package Index## Vulnerability Details **File Location**: `SKILL.md`, line 7 **Vulnerability Type**: Unpinned third-party dependencies and insufficient supply-chain verification **Risk Level**: Medium **Complete Code Snippet**: ```bash # Install the Binance Python SDK /usr/bin/python3.12 -m pip install python-binance ccxt ``` ### Technical Analysis The installation command retrieves `python-binance` and `ccxt` from pip without specifying reviewed versions, validating package hashes, using a lockfile, or identifying a trusted package index. Consequently, later installations can resolve to mutable future releases rather than the exact code assessed by the skill author. Python package installation may execute package-controlled build or installation logic. Imported package code also executes inside the user's Python process. In this skill, the Binance SDK receives API credentials from `BINANCE_API_KEY` and `BINANCE_API_SECRET` and is used for account access and live spot and futures trading. A compromised dependency release could therefore inspect process environment variables and misuse the permissions associated with those credentials. This finding does not establish that either named package is currently malicious. The vulnerability is the absence of dependency pinning and integrity verification, which leaves the installation and subsequent execution exposed to package-index, maintainer-account, build-pipeline, and upstream-release compromise. ### Attack Path 1. An attacker compromises a dependency maintainer account, release pipeline, distribution artifact, or another relevant supply-chain component. 2. The attacker publishes a malicious release under one of the dependency names. 3. A user follows the documented unpinned `pip install` command. 4. Pip resolves and installs the attacker-controlled release because no reviewed version or artifact hash is required. 5. Malicious code executes during installation or when the package is imp ...[truncated 941 chars]
- Remediation
- ## Remediation Suggestions 1. Pin each dependency to an explicitly reviewed version rather than resolving the latest available release. 2. Generate a lockfile or fully pinned requirements file containing transitive dependencies. 3. Record and enforce cryptographic hashes for every distribution artifact, such as with `pip install --require-hashes -r requirements.txt`. 4. Obtain packages only from an explicitly configured, trusted index and consider using an internally mirrored repository containing approved artifacts. 5. Install dependencies in a dedicated virtual environment under a non-privileged user account. 6. Scan and periodically review direct and transitive dependencies before updating pinned versions. 7. Use a Binance API key limited to the minimum required permissions. Disable withdrawals, enable IP allowlisting, use a dedicated subaccount, and apply exchange-supported trading limits where available. 8. Avoid exposing credentials during installation. Make credentials available only to the isolated runtime process after dependency integrity has been verified.
