T08 · Insecure Dependencies
- Location
skill.md:12- Finding
Unpinned Global npm Dependency Permits Supply-Chain Substitution
- Content
View full analysis
=0.1.2" verified_repo: https://github.com/ZhenRobotics/openclaw-memory-opportunity verified_commit: 28a1a92 ``` The installation instructions also direct users to install the dependency globally: ```bash npm install -g openclaw-memory-opportunity ``` ### Technical Analysis The version constraint `>=0.1.2` allows npm to resolve any current or future compatible release rather than the specific release represented by the declared verified commit. The `verified_commit` metadata does not cryptographically bind the downloaded npm archive to commit `28a1a92`, and the installation command does not specify an exact version or integrity digest. Because the actual npm package implementation is not included in the audited artifact, its claimed local-only and zero-network behavior cannot be independently verified from these files. A global npm installation may run package lifecycle scripts and makes the package CLI available in the user's environment. Consequently, compromise of the npm publisher account, registry package, or a later release could introduce arbitrary executable behavior after this Skill has been reviewed. ### Attack Path 1. An attacker compromises the package publisher account or otherwise gains the ability to publish a new version of `openclaw-memory-opportunity`. 2. The attacker publishes a malicious version greater than `0.1.2`. 3. A user follows the documented `npm install -g openclaw-memory-opportunity` instruction. 4. npm resolves the newly published version because it satisfies the open-ended dependency constraint. 5. Malicious lifecycle scripts or package CLI code execute with the privileges of the user running npm. 6. The malicious package may acce ...[truncated 722 chars]- Remediation
View remediation
=0.1.2`. 2. Publish and verify the npm archive's integrity digest or signed provenance before installation. 3. Ensure the npm package contents are reproducibly built from the declared repository commit. 4. Avoid global installation where possible; use a project-local dependency with a lockfile. 5. Use `npm ci` with a committed lockfile for reproducible installations. 6. Disable lifecycle scripts with `--ignore-scripts` when the package does not legitimately require them. 7. Audit each dependency update before changing the pinned version. 8. Consider bundling or vendoring the reviewed implementation so the installed code matches the audited artifact. ]]>
