T08 · Insecure Dependencies
Error
- Location
- SKILL.md:5
- Finding
- Unpinned External npm Package Executes with Wallet Signing Authority## Vulnerability Details **File Location**: `SKILL.md:5` **Vulnerability Type**: Unpinned privileged third-party dependency **Risk Level**: High The Skill delegates its core functionality to an external npm package without specifying an exact version or integrity hash: ```yaml metadata: {"openclaw":{"requires":{"bins":["clawcontract"],"env":["CLAWCONTRACT_OPENROUTER_API_KEY","CLAWCONTRACT_PRIVATE_KEY","CLAWCONTRACT_BSCSCAN_API_KEY"]},"install":[{"id":"clawcontract","kind":"node","package":"clawcontract","bins":["clawcontract"],"label":"Install clawcontract (npm)"}]}} ``` Related privileged behavior is documented in `SKILL.md:53-55`: ```markdown | `CLAWCONTRACT_OPENROUTER_API_KEY` | Yes | AI contract generation | | `CLAWCONTRACT_PRIVATE_KEY` | For deploy | Wallet for deployment — must be supplied by user | | `CLAWCONTRACT_BSCSCAN_API_KEY` | For verify | Contract verification on BscScan/opBNBScan | ``` The automatic deployment behavior is documented in `references/commands.md:38-53`: ```markdown ## deploy ```bash clawcontract deploy <file> --chain <chain> ``` Compiles and deploys the contract to the specified chain. Shows gas estimation and deploys automatically. `PRIVATE_KEY` must be set in the environment or `.env` — the CLI will error if it is missing. Supported chains: `bsc-mainnet`, `bsc-testnet`, `opbnb-mainnet`, `opbnb-testnet`. Default chain: `bsc-testnet`. Deployment to mainnet chains shows an extra warning message. ``` ### Technical Analysis The package declaration uses the unconstrained package name `clawcontract`; no exact version, package integrity hash, vendored implementation, or lockfile is present in the audited artifact. Consequently, the code executed after installation may differ from the code that was reviewed previously if a new release is published or the package distribution channel is compromised. This dependency is security-sensitive because it is expected to ...[truncated 2142 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `clawcontract` to a reviewed, exact package version rather than resolving the latest available release. 2. Record and verify the package integrity hash and commit a lockfile covering all transitive dependencies. 3. Vendor the reviewed CLI source into the Skill or include it as auditable source code so its credential handling, transaction construction, network requests, and file access can be inspected. 4. Disable npm lifecycle scripts during installation where they are not strictly required. If build scripts are required, review and explicitly allow only known scripts. 5. Add automated dependency provenance, signature, vulnerability, and integrity checks to the release process. 6. Run the CLI in an isolated environment with restricted filesystem and network access. 7. Use dedicated low-value wallets, preferably testnet-only or hardware-backed signers, rather than exposing a funded mainnet private key directly to the process. 8. Require explicit confirmation or policy approval before every mainnet deployment and state-changing transaction. A warning alone should not authorize signing. 9. Standardize the credential variable name across all documentation and implementation. Avoid recommending plaintext `.env` storage for private keys; use a protected secret manager or external signer. 10. Rotate all credentials immediately if the package or any dependency is suspected of compromise.
