T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:1
- Finding
- Third-Party Financial SDK Installed Without Artifact Integrity Verification## Vulnerability Details **File Location**: `requirements.txt:1`; installation instruction at `SKILL.md:12-15` **Vulnerability Type**: Supply-chain integrity weakness **Risk Level**: Medium ### Vulnerable Code `requirements.txt:1`: ```text python-kraken-sdk==3.2.7 ``` `SKILL.md:12-15`: ```bash ## Setup pip3 install -r requirements.txt ``` ### Technical Analysis The project pins `python-kraken-sdk` to a specific version, which reduces unintended version drift, but it does not pin the package artifact with a cryptographic hash. The documented installation command also does not use pip's `--require-hashes` option. Consequently, installation trusts the package artifact returned by the configured Python package index. The CLI imports this dependency and passes Kraken API credentials to SDK objects in `kraken_cli.py:25-32`. It also uses the SDK for sensitive account operations, including trading, staking allocation, and withdrawals. This does not establish that the pinned dependency is malicious. The weakness is the absence of artifact-level integrity verification for a dependency operating within a financially sensitive trust boundary. ### Attack Path 1. An attacker compromises the relevant package distribution channel, configured package index, or the artifact associated with the pinned release. 2. A user follows the setup instruction in `SKILL.md` and runs `pip3 install -r requirements.txt`. 3. Pip installs the substituted artifact because no expected SHA-256 hash is specified or enforced. 4. Malicious package code can execute during installation or when `kraken_cli.py` imports the SDK. 5. At runtime, the CLI supplies `KRAKEN_API_KEY` and `KRAKEN_API_SECRET` to SDK clients. 6. The malicious dependency can read process credentials, alter Kraken API operations, or perform other actions available to the local process and API key. ### Impact Assessment Successful exploitation could permit arbitrary code ...[truncated 576 chars]
- Remediation
- ## Remediation Suggestions 1. Generate a reviewed lock file containing SHA-256 hashes for every direct and transitive dependency. 2. Enforce hash validation during installation: ```bash pip install --require-hashes -r requirements.txt ``` 3. Obtain packages only from an explicitly configured, trusted index or an internally controlled artifact repository. 4. Review and verify the selected `python-kraken-sdk` release before approving its hashes. 5. Perform dependency vulnerability and provenance checks in CI, and require review for lock-file updates. 6. Install and run the Skill in an isolated virtual environment or container under a non-privileged operating-system account. 7. Use least-privilege Kraken API keys. Keep withdrawal permission disabled unless the withdrawal feature is explicitly required, and use separate credentials for read-only and transaction-capable workflows where practical. 8. Rotate Kraken credentials immediately if dependency compromise is suspected.
