T08 · Insecure Dependencies
Warning
- Location
- README.md:16
- Finding
- Unpinned Package Execution Through npx## Vulnerability Details **File Location**: `README.md:16` **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash npx clawhub install zhangmengyang/karpathy-wiki-improve ``` ### Technical Analysis The documented installation command invokes the `clawhub` npm package through `npx` without specifying a reviewed version or integrity constraint. If the package is not already available locally, `npx` can retrieve and execute the version currently resolved by the configured npm registry. This creates a supply-chain risk because the code executed by the installation command can change after this skill has been reviewed. A compromised maintainer account, malicious package release, registry compromise, or unexpected upstream update could cause users following the documentation to execute attacker-controlled code. The repository itself does not contain an embedded malicious script, and the audit found no evidence that the referenced package is currently malicious. The issue is the unsafe, unpinned execution mechanism. ### Attack Path 1. An attacker compromises the publication channel, maintainer account, or resolved package for the `clawhub` CLI. 2. The attacker publishes a malicious or backdoored version that remains compatible with the documented command. 3. A user follows the Quick Start instructions and runs `npx clawhub install zhangmengyang/karpathy-wiki-improve`. 4. `npx` resolves and downloads the compromised version because no package version or integrity value is specified. 5. The downloaded package executes with the privileges of the invoking user. 6. Malicious installation logic can access or modify data available to that user, subject to operating-system and sandbox restrictions. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the account running the installation command. The potential scope includes readable ...[truncated 395 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the CLI to a specific, reviewed version: ```bash npx clawhub@<reviewed-version> install zhangmengyang/karpathy-wiki-improve ``` 2. Document the expected npm registry and verified package identity so that scoped registry overrides or package-name confusion cannot silently alter the source. 3. Where supported, verify package provenance, signatures, checksums, or npm integrity metadata before execution. 4. Test and review each new CLI version before updating the documented pin. 5. Recommend running the installer as an unprivileged user in a restricted environment without unnecessary secrets. 6. For stronger reproducibility, install the reviewed dependency through a lockfile with integrity metadata and invoke the locally locked binary rather than resolving the latest package dynamically.
