T08 · Insecure Dependencies
Warning
- Location
- SETUP.md:8
- Finding
- Unpinned packages are downloaded and executed through npx<![CDATA[ ## Vulnerability Details **File Location**: `SETUP.md:8-10`, `SETUP.md:40-53`, and `SETUP.md:112-114` **Vulnerability Type**: Unverified third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash ## Quick Install ```bash npx clawhub install tokenbroker ``` ``` Additional affected commands include: ```bash npx clawhub install tokenbroker --github npx clawhub install tokenbroker --github --device npx clawhub install tokenbroker npx tokenbroker scan ./my-project ``` Related unpinned installation guidance also appears in `SKILL.md:163-165` and `SKILL.md:180-183`: ```bash npm install ``` ```bash npm install ethers ``` ### Technical Analysis The setup instructions recommend running packages through `npx` without an exact version, package integrity hash, lockfile, or other reproducibility control. `npx` may download and immediately execute the package version currently resolved by the configured npm registry. This creates a mutable supply-chain boundary: the code executed by users can differ from the code that was reviewed in this artifact. The project also lacks a package manifest and lockfile that would allow the effective dependency graph to be audited. The risk is elevated by the setup examples that export `GITHUB_TOKEN` before invoking the installer. Any compromised package executed in that process may inherit the caller's environment and filesystem permissions. ### Attack Path 1. An attacker compromises the `clawhub` or `tokenbroker` npm package, its publisher account, or the registry resolution path. 2. The attacker publishes a malicious version under the expected package name. 3. A user follows the documented unpinned `npx` command. 4. `npx` downloads and executes the malicious package. 5. The package reads environment variables, local project files, npm configuration, or other resources available to the invoking user. 6. The package exfiltrates data or modifies files with the user's privileges. Dependency confusio ...[truncated 776 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every executable package to an exact reviewed version: ```bash npx --yes clawhub@1.2.3 install tokenbroker npx --yes tokenbroker@1.0.0 scan ./my-project ``` 2. Publish and verify expected package integrity hashes before execution. 3. Include a complete `package.json` and lockfile in the reviewed artifact. 4. Use `npm ci` rather than unconstrained installation for reproducible dependency resolution. 5. Configure an explicitly trusted registry and prevent fallback to untrusted registries. 6. Run installers in a restricted environment without wallet secrets or unnecessary credentials. 7. Avoid exporting `GITHUB_TOKEN` into the environment of package installation processes. Inject it only into the specific runtime operation that requires GitHub access. 8. Add provenance verification, signed releases, and automated dependency auditing to the release process. ]]>
