T08 · Insecure Dependencies
Warning
- Location
- clawhub.json:3
- Finding
- Unpinned Third-Party SDK Is Entrusted with a Sensitive API Credential<![CDATA[ ## Vulnerability Details **File Location**: `clawhub.json:3-5`; credential handoff at `btc_momentum.py:23-32` **Vulnerability Type**: Unpinned dependency with access to credentials and financial operations **Risk Level**: Medium ### Vulnerable Code ```json "requires": { "pip": ["simmer-sdk", "requests"], "env": ["SIMMER_API_KEY"] }, ``` The unpinned SDK is subsequently given the API credential: ```python def get_client(venue="polymarket"): global _client if _client is None: try: from simmer_sdk import SimmerClient except ImportError: print("ERROR: simmer-sdk not installed. Run: pip install simmer-sdk") sys.exit(1) _client = SimmerClient( api_key=os.environ["SIMMER_API_KEY"], venue=venue, ) return _client ``` ### Technical Analysis The Skill declares `simmer-sdk` and `requests` without exact versions, integrity hashes, or a dependency lock file. Package resolution can therefore install a different version whenever the environment is rebuilt. This is particularly significant for `simmer-sdk`: it is imported into the process and directly receives `SIMMER_API_KEY`. It is also responsible for market queries and live-trade submission. Python package initialization and imported module code execute with the same operating-system privileges as the Skill. The reviewed project does not directly send the API key to Binance or another unrelated endpoint, and the external SDK implementation was not included in the audit. Consequently, there is no evidence that the current package intentionally exfiltrates the credential. The confirmed weakness is the absence of dependency integrity controls around a component trusted with sensitive credentials and financial operations. ### Attack Path 1. An attacker compromises the package publisher, package-index account, distribution infrastructure, or a transitive dependency. 2. The attacker publishes a malicious ...[truncated 944 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to a reviewed, exact version. 2. Generate a lock file containing versions and cryptographic hashes for direct and transitive dependencies. 3. Install with hash verification enabled, such as `pip install --require-hashes`. 4. Obtain `simmer-sdk` only from its verified official publisher and review release provenance before upgrades. 5. Run automated dependency vulnerability and package-integrity checks in CI. 6. Use a dedicated, revocable API credential with the minimum required trading scope and strict account-level spending limits. 7. Isolate the Skill in a restricted runtime with minimal filesystem and network access. 8. Establish an explicit, reviewed dependency-update process rather than accepting versions automatically. ]]>
