T08 · Insecure Dependencies
- Location
SKILL.md:46- Finding
Unpinned Package Execution Through npx
- Content
View full analysis
` - custom registry plus token: `CLAWHUB_REGISTRY=https://your-registry.example npx clawhub login --token ` - if the environment already provides `SKILLHUB_API_TOKEN`, `CLAWHUB_API_TOKEN`, or `CLAWHUB_TOKEN`, validate first with `npx clawhub whoami` - if no working token is available, ask the user for one before proceeding ``` Related workflow commands include: ```bash npx clawhub whoami npx clawhub login --token npx clawhub publish ./my-skill --slug my-skill --name "My Awesome Skill" --version 1.0.0 npx clawhub inspect my-skill ``` ### Technical Analysis The documented workflows invoke `clawhub` through `npx` without an exact package version or integrity check. If the package is absent locally, `npx` may retrieve it from the configured npm registry and execute it immediately. Consequently, the code executed during a future skill invocation can differ from the package reviewed when this audit was performed. This creates a supply-chain trust boundary involving the package publisher, npm registry, local npm configuration, and network path. A compromised release, malicious registry override, package-name takeover, or unexpectedly incompatible update could execute arbitrary JavaScript under the account running the agent. The exposure is especially significant for the login and publishing workflows because the invoked process may have access to registry tokens, local skill source files, the working directory, and other environment variables. ### Attack Path 1. An attacker compromises the `clawhub` package distribution channel, publishes a malicious update, or causes th ...[truncated 1176 chars]- Remediation
View remediation
whoami ``` 2. Prefer installing the dependency from a lockfile with integrity metadata and invoking the locked local binary: ```bash npm ci ./node_modules/.bin/clawhub whoami ``` 3. Document the authoritative package name, publisher, expected registry, version, and package integrity hash. 4. Prevent npm registry configuration from silently redirecting package resolution to an untrusted source. 5. Run the CLI in a least-privileged environment with access only to required files and credentials. 6. Review and update the pinned version through a controlled dependency-update process rather than resolving the latest release during execution. 7. Avoid exposing unrelated environment variables to the CLI process. ]]>
