T08 · Insecure Dependencies
- Location
SKILL.md:12- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–15
Vulnerability Type: Unpinned and globally installed third-party dependency
Risk Level: MediumVulnerable Code Snippet:
markdown ## Prerequisites - Node.js and npm installed - `depcheck` installed globally (`npm install -g depcheck`)Technical Analysis
The skill instructs users to install
depcheckglobally without specifying a reviewed version, lockfile, package integrity value, or trusted registry. Consequently,npmresolves 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
depcheckitself is malicious.Attack Path
- An attacker compromises a future
depcheckrelease, one of its transitive dependencies, or the registry used by the victim. - The victim follows the documented command
npm install -g depcheck. - npm resolves and downloads the uncontrolled package version and dependency graph.
- Malicious lifecycle scripts, if present and enabled, execute with the privileges of the invoking user.
- 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]
- An attacker compromises a future
- Remediation
View remediation
Remediation Suggestions
- Replace the global installation prerequisite with a project-local development dependency.
- Pin
depcheckto 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-scriptswhere 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.
