T08 · Insecure Dependencies
Error
- Location
- SKILL.md:20
- Finding
- Unpinned Third-Party Payment SDK Receives a Wallet Private Key<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-22`; related runtime use at `scripts/query.mjs:13,20-26` **Vulnerability Type**: Unpinned security-sensitive dependency **Risk Level**: High ### Vulnerable Code `SKILL.md:20-22`: ```yaml install: - kind: node package: NoFxAiOS/claw402-js ``` Related runtime code in `scripts/query.mjs:13,20-26`: ```js import { Claw402 } from 'claw402' const privateKey = process.env.WALLET_PRIVATE_KEY if (!privateKey) { console.error(JSON.stringify({ error: 'WALLET_PRIVATE_KEY environment variable is required' })) process.exit(1) } const gateway = process.env.CLAW402_GATEWAY ?? 'https://claw402.ai' const client = new Claw402({ privateKey, baseUrl: gateway }) ``` ### Technical Analysis The installation metadata references the external package or repository `NoFxAiOS/claw402-js` without an immutable version, commit identifier, or integrity hash. The project also contains no reviewed local implementation or lockfile establishing the exact dependency code that will execute. This dependency is security-sensitive because the script imports `Claw402` from it and passes `WALLET_PRIVATE_KEY` directly to its constructor. The audited project code does not explicitly transmit the key, and the documentation states that signing occurs locally. However, that guarantee ultimately depends on the behavior of dependency code that is not pinned or included in the audited project. The installation identifier (`NoFxAiOS/claw402-js`) also differs from the runtime import name (`claw402`). This may be legitimate packaging behavior, but it should be explicitly verified to prevent dependency substitution or confusion. ### Attack Path 1. An attacker compromises the mutable upstream package, repository, publishing account, or dependency-resolution path. 2. The attacker publishes code that preserves the expected `Claw402` interface while adding credential collection or unauthorized signing behavior. 3. A subsequent instal ...[truncated 1385 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the SDK to an immutable, reviewed release and exact version. 2. If installation occurs from a source repository, pin an audited commit hash rather than a branch or mutable tag. 3. Include a lockfile containing resolved versions and integrity hashes, and enforce immutable or frozen-lockfile installation in deployment. 4. Verify and document why the installation identifier is `NoFxAiOS/claw402-js` while the runtime import is `claw402`. 5. Audit the SDK code that receives `privateKey`, particularly all networking, telemetry, logging, signing, and payment-validation paths. 6. Consider vendoring the minimal signing implementation after review so changes are visible during Skill audits. 7. Run the script with a dedicated, low-balance wallet rather than a primary wallet. 8. Enforce per-call and per-session spending limits independently of the remote server. 9. Isolate the process with minimal filesystem access and a restricted environment containing only required variables. 10. Add dependency provenance and signature verification to the release process. ]]>
