T08 · Insecure Dependencies
Warning
- Location
- verify.md:41
- Finding
- Unpinned ClawHub Package Execution Through npx<![CDATA[ ## Vulnerability Details **File Location**: `verify.md`, lines 41–44 and 51 **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash npx clawhub publish <folder> \ --slug "<slug>" \ --name "<name>" \ --version "<version>" ``` ```bash npx clawhub install <slug> --dir /tmp/verify ``` ### Technical Analysis The documented publish and verification procedures execute `clawhub` through `npx` without specifying an exact package version or validating package integrity. If no trusted local installation is available, `npx` may retrieve the package from the configured package registry and execute its lifecycle or command code. Because the package reference is mutable, the code executed at runtime may differ from the version that was previously reviewed. A compromised package release, registry account, registry endpoint, or dependency could therefore introduce arbitrary code into both the publishing and optional post-publish verification workflows. This is a supply-chain weakness rather than evidence that the current `clawhub` package is malicious. ### Attack Path 1. An attacker compromises the `clawhub` package, one of its dependencies, its publishing account, or the package registry used by the environment. 2. The attacker publishes or serves a malicious package version under the expected package name. 3. The user approves publication, causing the agent to invoke `npx clawhub publish ...`; alternatively, the optional installation verification invokes `npx clawhub install ...`. 4. `npx` resolves the unversioned package reference and retrieves the attacker-controlled release when a trusted local copy is unavailable. 5. The downloaded package executes with the privileges and environment of the user running the agent. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the current user's privileges. The malicious package could access files readable by th ...[truncated 394 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to an exact, reviewed version rather than resolving the latest available release: ```bash npx --yes clawhub@<reviewed-exact-version> publish <folder> \ --slug "<slug>" \ --name "<name>" \ --version "<version>" ``` 2. Apply the same version pin to post-publish verification: ```bash npx --yes clawhub@<reviewed-exact-version> install <slug> --dir /tmp/verify ``` 3. Prefer a preinstalled, trusted CLI whose version and source are validated before execution. Abort if its version differs from the approved version. 4. Use a lockfile and registry integrity metadata where package installation is required. Configure a trusted registry explicitly and verify package provenance or signatures when supported. 5. Run the publishing process in a restricted environment with minimal filesystem access, minimal environment variables, and credentials scoped only to the required publication operation. 6. Review version updates before changing the pin, including the CLI package, lifecycle scripts, and transitive dependencies. ]]>
