T08 · Insecure Dependencies
Error
- Location
- clawhub.json:4
- Finding
- Unpinned privileged trading dependency creates supply-chain exposure<![CDATA[ ## Vulnerability Details **File Location**: `clawhub.json:4-9`; related imports and initialization at `fastloop_trader.py:101` and `fastloop_trader.py:182-194` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: High ### Vulnerable Code ```json "requires": { "env": [ "SIMMER_API_KEY" ], "pip": [ "simmer-sdk" ] } ``` Related runtime usage: ```python from simmer_sdk.skill import load_config, update_config, get_config_path ``` ```python def get_client(live=True): """Lazy-init SimmerClient singleton.""" 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) api_key = os.environ.get("SIMMER_API_KEY") if not api_key: print("Error: SIMMER_API_KEY environment variable not set") print("Get your API key from: simmer.markets/dashboard → SDK tab") sys.exit(1) venue = os.environ.get("TRADING_VENUE", "polymarket") _client = SimmerClient(api_key=api_key, venue=venue, live=live) return _client ``` ### Technical Analysis The package manifest requests `simmer-sdk` without an exact version or integrity hash. Package resolution can therefore select a future release that was not part of this audit. The dependency is imported into the same Python process that holds the Simmer API key and, according to the documented live-trading setup, may also hold `WALLET_PRIVATE_KEY`. Python packages can execute arbitrary code during installation and import. Consequently, a compromised package release or package-source substitution would run with all privileges granted to the trader process. This finding concerns dependency trust and pinning. The audited project does not itself contain evidence that the current `simmer-sdk` package is malicious. ### Attack Path 1. An attacker compromises ...[truncated 1106 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `simmer-sdk` to an exact, reviewed version rather than allowing unconstrained resolution. 2. Maintain a lock file containing transitive dependency versions. 3. Require package hashes, such as with `pip install --require-hashes`, and verify artifacts through a trusted package index. 4. Review the package publisher, release history, source repository, and build provenance before deployment. 5. Install dependencies in an isolated virtual environment or container under an unprivileged account. 6. Restrict outbound network access to the documented Simmer, Polymarket, Gamma, and Binance endpoints. 7. Isolate wallet signing from the strategy process where possible, using a constrained signer that authorizes only expected venues, amounts, and operations. 8. Rotate trading credentials immediately if dependency compromise is suspected. ]]>
