T08 · Insecure Dependencies
- Location
scripts/install.sh:63- Finding
Unpinned npm Package Is Downloaded and Installed Globally
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install.sh:63-70
Vulnerability Type: Unpinned third-party dependency installed with global scope
Risk Level: MediumComplete Code Snippet
bash # Install Claude Code CLI install_claude_code() { print_info "Installing Claude Code CLI globally..." if npm install -g @anthropic-ai/claude-code; then print_success "Claude Code CLI installed successfully" else print_error "Failed to install Claude Code CLI" exit 1 fiThe same unpinned command is recommended in
SKILL.md:77-81andREADME.md:54-57.Technical Analysis
The installer downloads the package version currently associated with the npm registry's default distribution tag. Neither an exact version nor an integrity hash is specified. Consequently, the effective code executed by this Skill can change after the Skill package itself has been audited.
npm packages may execute lifecycle scripts during installation. Because the command uses
-g, package files and executable links are written into the global npm prefix. If the installer is run as root—as suggested by several/rootpaths in the documentation—package lifecycle code executes with root privileges. Even without root, it executes with the invoking user's permissions and can access that user's files, environment, and OpenClaw workspace.The package name appears consistent with Anthropic's documented package; there is no evidence in the audited repository that it is currently malicious. The vulnerability is the absence of version and integrity controls, which creates exposure to registry compromise, maintainer-account compromise, or an unsafe future release.
Attack Path
- An attacker compromises the upstream npm publisher, registry delivery path, or a future package release.
- The attacker publishes a malicious version under the package's default distribution tag.
- A user ...[truncated 951 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the package to an explicitly reviewed version, for example:
bash CLAUDE_VERSION='2.1.75' npm install -g --ignore-scripts "@anthropic-ai/claude-code@${CLAUDE_VERSION}" - Verify the package tarball against a trusted, repository-maintained integrity value before installation. Do not rely only on a mutable npm distribution tag.
- Determine whether lifecycle scripts are necessary. Prefer
--ignore-scripts; if scripts are required, review them for the pinned release before allowing execution. - Avoid root execution. Install into a dedicated, user-owned npm prefix or isolated container with access only to the required workspace.
- Record the resolved package version and integrity digest in installation logs.
- Add an allowlist check for the expected npm registry and fail if npm is configured to use an untrusted registry.
- Update
SKILL.mdandREADME.mdso their manual installation commands use the same pinned, verified process.
- Pin the package to an explicitly reviewed version, for example:
