T08 · Insecure Dependencies
- Location
kb.sh:9- Finding
Unpinned Third-Party CLI Dependency and Global Installation Guidance
- Content
View full analysis
/dev/null; then echo "Error: ragclaw CLI not found. Install with: npm install -g @emdzej/ragclaw-cli" exit 1 fi ``` `skill.json:65-67`: ```json "dependencies": { "cli": "@emdzej/ragclaw-cli" } ``` ### Technical Analysis The project delegates nearly all substantive functionality to the external `@emdzej/ragclaw-cli` npm package. The dependency declaration does not specify an exact version, and the installation instruction uses `npm install -g` without a version or integrity constraint. Consequently, users following the instruction receive whichever package release the npm registry resolves at installation time rather than a release whose source and integrity were audited with this Skill. This creates a supply-chain trust boundary that is not controlled by the audited repository. If the publisher account, package, registry delivery path, or a future package release is compromised, the globally installed CLI can execute attacker-controlled code. The external package implementation was not included in the audited project, so its internal behavior could not be verified. The wrapper itself quotes `"$RAGCLAW_BIN"` and forwards arguments using `"$@"`; no shell command-injection flaw was identified in that forwarding logic. The issue is specifically the mutable, unpinned external dependency and global installation guidance. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, or another relevant part of the distribution chain for `@emdzej/ragclaw-cli`. 2. The attacker publishes a malicious release under the expected package name. 3. A user follows the displayed instruction: `npm install -g @emdzej/ragcla ...[truncated 1290 chars]- Remediation
View remediation
``` 3. Record and verify package integrity metadata using an npm lockfile or another reproducible dependency-management mechanism. 4. Prefer a project-local installation over a global installation, and invoke the binary from the controlled local dependency directory. 5. Include the dependency source or a verifiable build artifact in the audit scope before release. 6. Use automated dependency scanning, release-signature or provenance verification, and publisher-account protections. 7. Define an explicit upgrade process in which new dependency versions are reviewed and tested before the pinned version is changed. 8. Consider validating the resolved executable path before invocation so the wrapper does not unintentionally execute an unrelated `ragclaw` binary found earlier in `PATH`. ]]>
