T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:26
- Finding
- Unpinned Global Installation of a Third-Party CLI Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 26 **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ### Vulnerable Code ```markdown - `clawhub` CLI installed (`npm i -g clawhub`). ``` ### Technical Analysis The documented command installs the latest available version of the `clawhub` npm package globally. It does not pin a reviewed version, verify package integrity, enforce a trusted registry, or otherwise constrain which package artifact npm retrieves. npm package installation can run package lifecycle scripts with the privileges of the invoking user. Consequently, a compromised package release, registry account, or package resolution path could cause attacker-controlled code to execute during installation. Global installation also increases the scope of resulting filesystem changes compared with a project-local dependency. This finding does not establish that the current `clawhub` package is malicious. The vulnerability is the unsafe and non-reproducible dependency installation practice. ### Attack Path 1. An attacker compromises the package publisher, registry account, distribution infrastructure, or a future package release. 2. The attacker publishes a malicious version under the package name used by the documentation. 3. A user follows the prerequisite and runs `npm i -g clawhub` without a version constraint. 4. npm resolves and installs the attacker-controlled release. 5. Malicious lifecycle code executes with the permissions of the user running npm. 6. The compromised package can modify files accessible to that user, steal available credentials, or replace globally installed CLI behavior. ### Impact Assessment Successful exploitation can provide arbitrary code execution with the privileges of the user performing the installation. The attacker could access that user's files and environment variables, steal npm or ClawHub credentials available in the execution context, tampe ...[truncated 273 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to a specifically reviewed version, for example: ```bash npm install --global clawhub@1.0.0 ``` 2. Prefer a project-local, lockfile-controlled installation instead of a global installation: ```bash npm install --save-dev --save-exact clawhub@1.0.0 npx clawhub@1.0.0 whoami ``` 3. Commit and review the generated lockfile so dependency resolution is reproducible. 4. Configure npm to use an explicitly trusted registry and avoid unreviewed mirrors. 5. Verify package provenance, signatures, or published integrity data where supported. 6. Review package lifecycle scripts and dependency changes before updating the pinned version. 7. Do not recommend running npm installation commands with `sudo` or another elevated account. ]]>
