T08 · Insecure Dependencies
Warning
- Location
- PUBLISH.md:19
- Finding
- Unpinned Global npm Dependency Installation## Vulnerability Details **File Location**: `PUBLISH.md`, lines 19–23 **Vulnerability Type**: Supply-chain risk from an unpinned third-party dependency **Risk Level**: Medium **Vulnerable Code**: ```markdown Install the ClawHub CLI if needed: ```bash npm i -g clawhub ``` ``` ### Technical Analysis The publishing instructions install the latest version of the `clawhub` npm package globally. No version, lockfile, package integrity value, provenance requirement, or lifecycle-script restriction is specified. Because the package version is mutable, the code executed by this command may differ from what maintainers previously reviewed. npm packages can execute lifecycle scripts during installation, and the subsequently invoked CLI can execute package-controlled logic. The global installation scope also places the executable in a shared user or system tool location rather than isolating it to this project. The project does not vendor the dependency or provide package metadata that would allow its contents and transitive dependencies to be audited as part of this review. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, or a transitive dependency, or causes an unsafe future version to be published. 2. A project maintainer follows `PUBLISH.md` and runs `npm i -g clawhub`. 3. npm resolves the mutable latest package version and downloads its dependency tree. 4. Malicious package lifecycle code may execute during installation with the maintainer's current privileges. 5. The globally installed `clawhub` executable may subsequently execute attacker-controlled behavior during login or publication. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user running npm. Potential effects include access to files and credentials available to that account, theft of publishing credentials, tampering with artifacts, and replacement or modification of ...[truncated 235 chars]
- Remediation
- ## Remediation Suggestions - Pin the CLI to a specifically reviewed version rather than resolving the latest release. - Prefer a project-local development dependency governed by a committed lockfile instead of a global installation. - Invoke the pinned local executable through the package manager while preventing unexpected version resolution. - Verify npm registry provenance, publisher identity, package integrity, and release signatures where available. - Audit the selected package version and its transitive dependencies before use. - Disable lifecycle scripts during installation unless the reviewed package explicitly requires them. - Run publishing tools in a minimally privileged, isolated environment with narrowly scoped and short-lived credentials. - Document the validated package version and a controlled process for reviewing upgrades.
