T08 · Insecure Dependencies
- Location
SKILL.md:337- Finding
Unpinned Global Installation of an Executable npm Dependency
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 337
Vulnerability Type: Unpinned third-party executable dependency installed globally
Risk Level: MediumVulnerable Code
markdown | Code CLI | CLI tool | Required | `npm install -g @anthropic-ai/claude-code` |Technical Analysis
The skill directs users to install
@anthropic-ai/claude-codeglobally without specifying an exact reviewed version, lockfile, or package-integrity value.Because the requested version is not pinned, npm resolves the package version available under the applicable default version tag at installation time. Consequently, the installed artifact can differ from the artifact assessed when this skill was reviewed. npm packages can also define lifecycle scripts that execute during installation unless those scripts are explicitly disabled.
The
-goption installs the package into the user's global npm environment and exposes its command globally. This expands the potential impact beyond an isolated project dependency. The documentation does not prescribe provenance validation, integrity verification, lifecycle-script restrictions, or an isolated installation environment.No evidence indicates that the named package is currently malicious. The vulnerability is the unsafe dependency installation practice and the resulting supply-chain exposure.
Attack Path
- An attacker compromises the package publisher account, package release process, npm registry delivery path, or another relevant supply-chain component.
- The attacker publishes a malicious version under the package's normal distribution tag.
- A user follows the skill's documented command:
bash npm install -g @anthropic-ai/claude-code - npm resolves and downloads the attacker-controlled release because no exact version or integrity value is required.
- Malicious package content or installation lifecycle scripts execute with the privileges of the user running npm.
- The globa ...[truncated 948 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the dependency to an exact, reviewed version rather than relying on a mutable distribution tag:
bash npm install --save-dev --save-exact @anthropic-ai/claude-code@<reviewed-version> -
Prefer a project-local installation over
-g, and invoke the binary through a package script or another controlled local mechanism. -
Commit and enforce a lockfile so dependency resolution is reproducible. Use
npm ciin automated environments rather than an unconstrained install. -
Verify package provenance and integrity before use. Document the expected publisher, package source, exact version, and approved integrity digest.
-
Disable lifecycle scripts during installation where operationally feasible:
bash npm ci --ignore-scriptsIf lifecycle scripts are necessary, review them before permitting execution.
-
Run dependency installation and the CLI in a least-privileged, isolated environment such as a dedicated container or restricted build worker. Do not install it using an administrator or root account.
-
Add automated dependency scanning and release approval controls. Require review before updating the pinned version or lockfile.
-
