T08 · Insecure Dependencies
- Location
SKILL.md:73- Finding
Unpinned Global Installation of a Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 73
Vulnerability Type: Unpinned global npm dependency installation
Risk Level: MediumVulnerable Code Snippet:
bash npm install -g cheerioTechnical Analysis
The skill instructs users to install
cheerioglobally without specifying a reviewed version or using a lockfile. Consequently, npm resolves whichever package version and transitive dependencies are current at installation time. The audited content therefore does not fully determine the code that will be installed.npm package installation can invoke package lifecycle scripts unless explicitly disabled. If the named package, one of its transitive dependencies, or the relevant registry delivery path becomes compromised, installation could execute attacker-controlled code with the privileges of the user running npm. The global
-goption also changes the user's shared Node.js environment rather than isolating the dependency to this skill.This is a supply-chain exposure rather than evidence that the current
cheeriopackage is malicious.Attack Path
- An attacker compromises a future release of
cheerio, one of its transitive dependencies, or the package distribution path. - A user follows the instruction in
SKILL.mdand runsnpm install -g cheerio. - npm resolves and downloads the then-current, unpinned package graph.
- Malicious package content or lifecycle behavior runs during installation or later when the installed module is used.
- The payload operates under the privileges of the npm process and may affect the user's globally shared Node.js environment.
Impact Assessment
Successful exploitation could execute code with the privileges of the user performing the installation. Depending on those privileges, the payload could read or modify files accessible to that user, access environment variables and developer credentials, make network requests, or tamper ...[truncated 275 chars]
- An attacker compromises a future release of
- Remediation
View remediation
Remediation Suggestions
- Pin
cheerioto a specifically reviewed version rather than resolving the latest release dynamically. - Declare it as a local project dependency instead of recommending global installation.
- Generate and commit a lockfile so direct and transitive dependency versions are reproducible.
- Use
npm ciin a dedicated, least-privileged project directory for deterministic installation. - Where compatible with the package, disable lifecycle scripts during installation with
--ignore-scripts. - Review package provenance, integrity metadata, maintainers, and transitive dependencies before updating the pinned version.
- Run dependency auditing and update only after security review and testing.
- Avoid executing npm installation commands with administrative or root privileges.
- Pin
