T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unpinned Global Installation of a Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, lines 12–15 **Vulnerability Type**: Unpinned and globally installed third-party dependency **Risk Level**: Medium **Vulnerable Code Snippet**: ```markdown ## Prerequisites - Node.js and npm installed - `depcheck` installed globally (`npm install -g depcheck`) ``` ### Technical Analysis The skill instructs users to install `depcheck` globally without specifying a reviewed version, lockfile, package integrity value, or trusted registry. Consequently, `npm` resolves whichever version is current through the user's configured registry at execution time. An npm installation may execute package lifecycle scripts and install transitive dependencies. Because the installation is global, any malicious package code runs with the invoking user's privileges and can modify the user's global Node.js environment. The effective installed code can also change after this skill has been reviewed. This issue is conditional upon compromise or manipulation of the package, one of its transitive dependencies, or the configured npm registry. The audited file contains no evidence that `depcheck` itself is malicious. ### Attack Path 1. An attacker compromises a future `depcheck` release, one of its transitive dependencies, or the registry used by the victim. 2. The victim follows the documented command `npm install -g depcheck`. 3. npm resolves and downloads the uncontrolled package version and dependency graph. 4. Malicious lifecycle scripts, if present and enabled, execute with the privileges of the invoking user. 5. The malicious package can access user-readable data and alter files or global Node.js packages permitted by those privileges. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the account running npm. The attacker could read or modify files accessible to that account, access environment variables and developer credentials available to the process, tamper with the globa ...[truncated 264 chars]
- Remediation
- ## Remediation Suggestions - Replace the global installation prerequisite with a project-local development dependency. - Pin `depcheck` to a specifically reviewed version and commit the resulting lockfile. - Install dependencies using a reproducible command such as `npm ci`. - Explicitly document and enforce the expected trusted npm registry. - Verify package provenance and integrity before installation. - Disable lifecycle scripts during installation with `--ignore-scripts` where compatible with the reviewed package. - Run dependency-analysis tooling in an isolated, least-privileged environment without production credentials or sensitive environment variables. - Periodically review the pinned package and its transitive dependencies before upgrading.
