T08 · Insecure Dependencies
- Location
scripts/setup_claude_mcp.sh:62- Finding
Unpinned Global Installation of a Third-Party CLI Package
- Content
View full analysis
/dev/null 2>&1; then echo "[1/7] Installing Claude CLI..." npm install -g @anthropic-ai/claude-code ``` The same unsafe installation command is recommended in the Skill instructions: ```bash npm install -g @anthropic-ai/claude-code ``` ### Technical Analysis The bootstrap installs the latest available version of `@anthropic-ai/claude-code` globally without pinning an audited version or verifying package integrity. An npm installation may execute package lifecycle scripts using the invoking user's privileges. The `-g` option also modifies the user's or system's global executable environment rather than an isolated project environment. Although the package name is associated with the expected vendor and no malicious package is embedded in this repository, the effective code installed by this command can change after the Skill has been reviewed. This creates a supply-chain trust boundary that is not controlled by the audited project. ### Attack Path 1. An upstream npm account, publishing pipeline, package release, or dependency is compromised. 2. A malicious or unexpectedly unsafe version becomes the latest release of `@anthropic-ai/claude-code`. 3. A user runs the recommended `setup_claude_mcp.sh` bootstrap on a host where `claude` is absent. 4. npm downloads the current release and executes any applicable installation lifecycle code. 5. The package gains the invoking user's privileges and installs a globally accessible executable. 6. Malicious code could access user files, credentials, environment variables, or establish persistence subject to the user's permissions. ### Impact Assessment Successful exploitation provides code e ...[truncated 530 chars]- Remediation
View remediation
``` 2. Verify the expected package integrity, provenance, and publisher before installation. 3. Avoid automatic global installation. Detect the missing CLI and instruct the user to install it only after explicit confirmation. 4. Prefer an isolated project-local installation or a controlled package runner with a pinned version. 5. Record and periodically review the approved version instead of silently accepting the newest release. 6. Where supported, enforce npm provenance/signature verification and use a trusted registry configuration. 7. Clearly disclose that installation may execute third-party lifecycle scripts and modify the global command environment. ]]>
