T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unpinned npm Dependency Introduces Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, line 12 **Vulnerability Type**: Unpinned and unaudited third-party dependency installation **Risk Level**: Medium **Code Snippet**: ```text ## Setup npm install clawhub clawhub publish /home/cc/.openclaw/workspace/skills/msp-toolkit ``` ### Technical Analysis The setup instructions install the `clawhub` npm package without specifying an exact version, lockfile, or integrity hash. Consequently, the package content retrieved when the command is run may differ from the content available when the skill was audited. npm packages can define installation lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, which npm may execute automatically. If the package or one of its transitive dependencies is compromised, replaced, or maliciously updated, following this instruction could execute attacker-controlled code. The audited project does not include the dependency source, a package manifest, or a lockfile with which to verify its behavior or provenance. There is no evidence in the reviewed file that the named package is currently malicious. The vulnerability is the unsafe reliance on a mutable, externally maintained dependency without version or integrity controls. ### Attack Path 1. An attacker compromises the `clawhub` npm package, its maintainer account, or a transitive dependency. 2. The attacker publishes a malicious release or introduces a malicious npm lifecycle script. 3. A user follows the setup instruction and runs `npm install clawhub`. 4. npm retrieves the mutable package release and resolves its dependency tree. 5. Malicious lifecycle code executes with the permissions of the user running npm. 6. Depending on those permissions, the payload could access user-readable files, modify the workspace, steal available credentials or tokens, or establish additional malicious behavior. ### Impact Assessment Successful exploitation could provide ...[truncated 550 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `clawhub` to an exact, reviewed version rather than installing the latest mutable release. 2. Add a package manifest and committed lockfile containing registry-resolved integrity metadata. 3. Use `npm ci` for reproducible installations after validating the lockfile. 4. Prefer `npm ci --ignore-scripts` when package lifecycle scripts are not required. 5. If lifecycle scripts are necessary, audit them and all relevant transitive dependencies before permitting execution. 6. Verify the package's registry provenance, maintainer identity, signatures or attestations where available, and published integrity values. 7. Run dependency installation as an unprivileged user in an isolated environment with no production credentials. 8. Document the expected package version and checksum in `SKILL.md`.
