T08 · Insecure Dependencies
Warning
- Location
- references/cli.md:10
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `references/cli.md`, lines 10–12 **Vulnerability Type**: Unpinned npm dependency execution **Risk Level**: Medium ```bash # Global install npm install -g @slicekit/erc8128-cli # Or use directly with npx npx @slicekit/erc8128-cli curl <url> ``` ### Technical Analysis The documented commands resolve `@slicekit/erc8128-cli` without specifying an exact, reviewed version or integrity constraint. Consequently, the code installed or executed can change after the Skill itself has been reviewed. The `npx` command is particularly sensitive because it may download and immediately execute the latest package version. Global npm installation can also run package lifecycle scripts and place executable files in user-level or system-level locations, depending on npm configuration. Such package code runs with the privileges of the user invoking the command. This is especially relevant because the CLI is intended to process Ethereum wallet credentials through key files, encrypted keystores, command-line arguments, or the `ETH_PRIVATE_KEY` environment variable. Although the reviewed documentation does not instruct the CLI to transmit raw private keys, a compromised future package version or transitive dependency could access those credentials. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry resolution path, or a transitive dependency. 2. The attacker publishes a malicious version under the legitimate package name. 3. An Agent follows the documented unpinned `npm install -g` or `npx` command. 4. npm resolves the compromised release and executes its lifecycle or runtime code with the invoking user's privileges. 5. The malicious code reads accessible wallet key files, environment variables such as `ETH_PRIVATE_KEY`, request bodies, configuration files, or other user-readable data. 6. The malicious code can exfiltrate collected data, ...[truncated 1036 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the CLI to an exact, reviewed version, for example: ```bash npm install --save-exact @slicekit/erc8128-cli@<reviewed-version> npx --yes @slicekit/erc8128-cli@<reviewed-version> curl <url> ``` 2. Prefer a project-local installation governed by a committed lockfile instead of a global installation. 3. Verify npm package provenance, registry origin, published checksums, signatures, and integrity metadata before use. 4. Review the pinned package, its lifecycle scripts, and its full transitive dependency tree. Re-review dependency changes before upgrading. 5. Use `npm ci` with a trusted lockfile in automated environments to prevent unexpected dependency resolution. 6. Disable lifecycle scripts where compatible with the package, or perform installation in an isolated build environment before execution. 7. Run the CLI in a sandbox or container under a dedicated least-privilege account. Expose only the specific request data and signing interface required for the operation. 8. Prefer encrypted keystores, hardware wallets, or an external signing service over raw key files, command-line keys, and environment-variable keys. 9. Restrict key-file permissions and network egress so that the CLI can contact only explicitly approved ERC-8128 endpoints. 10. Document a trusted package version and upgrade-validation process directly in the Skill instructions.
