T08 · Insecure Dependencies
- Location
SKILL.md:23- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 23–25
Vulnerability Type: Supply-chain exposure through an unpinned global dependency
Risk Level: Mediumbash # If it is not installed, install it with npm (CodeGraph supports Windows) npm install -g tree-sitter-cliTechnical Analysis
The Skill instructs the user or agent to install
tree-sitter-cliglobally without specifying a reviewed version, lockfile, package integrity hash, or trusted registry. As a result, the package contents installed at execution time can differ from those reviewed when the Skill was published.npm packages can execute lifecycle scripts during installation. If the package, its maintainer account, one of its transitive dependencies, or the configured npm registry is compromised, installation could execute attacker-controlled code with the privileges of the user running the command. The global
-ginstallation also gives the installed package broader availability and impact than a project-local dependency.The audit found no evidence that
tree-sitter-cliis currently malicious. The vulnerability is the unsafe and non-reproducible dependency installation procedure.Attack Path
- An attacker compromises the npm package, a transitive dependency, a maintainer account, or the user's configured npm registry.
- The attacker publishes or serves a modified package version containing a malicious lifecycle script or executable.
- A user or agent follows the Skill instructions and runs
npm install -g tree-sitter-cli. - npm retrieves the current package version rather than a version previously reviewed by the Skill author.
- Malicious installation code executes with the invoking user's privileges.
- The globally installed executable remains available to later commands and may access or modify resources available to that user.
Impact Assessment
Successful exploitation could provide arbitrary code executi ...[truncated 669 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a specifically reviewed version instead of installing the latest release:
bash npm install --save-dev --save-exact tree-sitter-cli@<reviewed-version> - Prefer a project-local installation over
-g, and invoke it through the local package runner ornode_modules/.bin. - Commit a lockfile and use
npm cito obtain reproducible dependency resolution. - Verify package provenance and integrity through a trusted registry, package-lock integrity metadata, and npm provenance information where available.
- Review direct and transitive dependencies before approving version updates.
- Run installation without elevated privileges and in a sandbox or isolated development environment when possible.
- If lifecycle scripts are unnecessary, consider initially installing with
--ignore-scripts, then explicitly enable only reviewed build steps. - Document the approved package version and update process in the Skill so agents do not automatically install an unreviewed future release.
- Pin the dependency to a specifically reviewed version instead of installing the latest release:
