T08 · Insecure Dependencies
- Location
SKILL.md:22- Finding
Unpinned Global npm Package Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 22–26
Vulnerability Type: Unverified and unpinned third-party dependency installation
Risk Level: Mediummarkdown If `mddoc` is not installed: ```bash npm install -g mddoc-clitext ### Technical Analysis The Skill instructs the agent to install the latest available version of `mddoc-cli` globally when the `mddoc` executable is unavailable. The package version and integrity are not pinned or verified. An npm installation may execute package lifecycle scripts with the privileges of the invoking user. Because the installation is global, it also modifies the user's system-wide Node.js executable environment rather than containing the dependency within the project. Consequently, a compromised or malicious future release of `mddoc-cli`, or one of its transitive dependencies, could execute arbitrary commands during installation and expose a different effective payload than the version originally reviewed. The audit found no evidence that the current package is malicious. The vulnerability is the unsafe dependency acquisition and installation process. ### Attack Path 1. An attacker compromises the `mddoc-cli` package, its publishing account, or a transitive dependency and publishes a malicious release. 2. A user invokes this Skill on a system where the `mddoc` executable is unavailable. 3. Following the Skill instructions, the agent runs `npm install -g mddoc-cli`. 4. npm retrieves the current package release and its dependencies without enforcing an audited version or expected integrity value. 5. Malicious package lifecycle code executes with the permissions of the user running the agent. 6. The malicious release may access user-readable files, modify user-writable files, make network connections, or install or replace globally available Node.js commands. ### Impact Assessment Successful exploitation could provide arbitrary code execution wi ...[truncated 537 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
mddoc-clito a specifically reviewed version rather than installing the latest release:bash npm install --save-dev --ignore-scripts mddoc-cli@<reviewed-version> - Prefer a project-local dependency over a global installation, and invoke it through a controlled package script or an explicitly resolved local binary.
- Commit and enforce a lockfile with integrity hashes. Use
npm ciin automated environments so dependency resolution cannot silently drift. - Disable npm lifecycle scripts with
--ignore-scriptsunless the reviewed package demonstrably requires them. If scripts are required, inspect them and execute installation in a sandbox with minimal filesystem, credential, and network access. - Require explicit user approval before installing missing software or modifying the user's executable environment.
- Document the expected package publisher and official registry source, and configure npm to use an approved registry.
- Run package provenance, signature, vulnerability, and integrity checks before installation.
- Fail safely when the dependency is missing instead of automatically installing an unreviewed release.
- Pin
