T08 · Insecure Dependencies
- Location
SKILL.md:27- Finding
Unpinned Global Installation of a Third-Party npm Dependency
- Content
View full analysis
&1 && echo "ready" || echo "not_installed" ``` ```bash npm install -g better-sqlite3 ``` ### Technical Analysis The Skill instructs the agent to install `better-sqlite3` globally if the module is unavailable. The installation does not specify an exact version, use a lockfile, verify an integrity hash, or isolate the package inside the project. Consequently, the installed code is determined by the package registry state at execution time rather than by the reviewed Skill artifact. npm installation may also run package lifecycle scripts with the permissions of the user running the agent. The global `-g` installation expands the affected scope beyond this Skill and modifies the user's shared Node.js environment. No evidence in the audited files indicates that `better-sqlite3` is currently malicious. The vulnerability is the mutable, unpinned, globally installed dependency chain. ### Attack Path 1. The user invokes the bookkeeping Skill. 2. The dependency check reports that `better-sqlite3` is unavailable. 3. Following `SKILL.md`, the agent executes `npm install -g better-sqlite3`. 4. npm retrieves the package and its dependency graph as they exist in the configured registry at that time. 5. If the package, a transitive dependency, maintainer account, or configured registry has been compromised, malicious installation code can execute. 6. The malicious code runs with the invoking user's permissions and may modify files, access user-readable information, or tamper with the global Node.js environment. ### Impact Assessment Successful exploitation would provide code execution with the privileges of the user running npm. The affected scope could include: - Files and credentials readable or writable by that user. - The ...[truncated 411 chars]- Remediation
View remediation
