T08 · Insecure Dependencies
Error
- Location
- SKILL.md:5
- Finding
- Unreviewed External npm Package Handles Wallet Private Keys## Vulnerability Details **File Location**: `SKILL.md:5-19` **Vulnerability Type**: Supply-chain exposure involving a privileged third-party dependency **Risk Level**: High ### Evidence ```yaml metadata: author: kvhnuke version: 0.0.10 openclaw: requires: env: - CHAINAI_PRIVATE_KEY bins: - npx - node primaryEnv: CHAINAI_PRIVATE_KEY emoji: '⧫' homepage: https://github.com/kvhnuke/chainai install: - kind: node package: chainai bins: [chainai] ``` Runtime execution is subsequently documented as: ```bash npx chainai@0.0.10 <command> [options] ``` ### Technical Analysis The Skill delegates all sensitive blockchain operations to the externally distributed `chainai` npm package. The installation metadata names `chainai` without an exact version or integrity digest, even though the runtime examples request version `0.0.10`. The audited project contains only `SKILL.md`; it does not include the package implementation needed to verify how the private key is read, stored, logged, or transmitted. Network access is necessary for balance queries, blockchain broadcasts, transaction-status checks, and 1inch Fusion swaps. However, giving externally retrieved executable code direct access to `CHAINAI_PRIVATE_KEY` exceeds the privileges needed for read-only operations and creates a severe supply-chain trust boundary. Documentation prohibiting key transmission does not technically enforce that behavior in the npm implementation. Running the package through `npx` may download and immediately execute registry-hosted code. Without artifact integrity verification or bundled auditable source, a compromised package release, publisher account, registry response, installation script, or dependency could access the private key and create arbitrary signatures. ### Attack Path 1. An attacker compromises the npm package, its publis ...[truncated 1331 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the installation metadata to an exact package version rather than specifying only `package: chainai`. 2. Lock the complete dependency graph and verify package integrity with a trusted digest, npm lockfile, and registry provenance. 3. Include or vendor the executable source in the reviewed Skill so its key handling, network destinations, installation scripts, and transitive dependencies can be audited. 4. Establish reproducible builds that prove the reviewed source corresponds to the published npm artifact. 5. Separate read-only operations from signing operations. Balance and status queries should run without access to `CHAINAI_PRIVATE_KEY`. 6. Prefer a hardware wallet, isolated signer, or narrowly scoped signing service so external package code never receives the raw private key. 7. Restrict outbound network access for signing-only commands. Permit only explicit, reviewed blockchain RPC and swap endpoints for commands that genuinely require networking. 8. Run the package in a sandbox with minimal filesystem, environment, process, and network access. 9. Audit the exact npm release and its transitive dependencies before allowing it to handle funded wallets.
