T08 · Insecure Dependencies
Error
- Location
- SKILL.md:24
- Finding
- Unpinned Global Installation of a Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 24-31 **Vulnerability Type**: Untrusted and unpinned third-party dependency installation **Risk Level**: High ### Vulnerable Code ```bash **Step 2: Check whether mcp-cloudplus is installed** ```bash which mcp-cloudplus ``` If the command does not exist, perform the installation: ```bash npm install -g cloudplus-mcp-server ``` ``` The prose shown in the original file is written in Chinese; the executable commands above are reproduced exactly. ### Technical Analysis The skill instructs the agent to install `cloudplus-mcp-server` globally from the npm registry whenever `mcp-cloudplus` is unavailable. The installation does not specify a reviewed version, package integrity hash, trusted registry, lockfile, or provenance requirement. Consequently, npm resolves and installs whatever release is current at execution time. npm packages can execute lifecycle scripts during installation, and global installation places package executables in a shared command path. A compromised maintainer account, malicious package release, registry compromise, or unexpected upstream change could therefore result in arbitrary code execution. Because the executable is installed globally, the action also modifies the user's persistent development environment rather than creating an isolated, task-scoped dependency. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or its distribution path and publishes a malicious release. 2. The target environment does not already contain the `mcp-cloudplus` executable. 3. The agent follows the skill instructions and runs `npm install -g cloudplus-mcp-server`. 4. npm downloads the current unpinned release. 5. Malicious package files or lifecycle scripts execute with the privileges of the account running npm. 6. The package can install a malicious `mcp-cloudplus` executable globally. 7. Subsequent CloudPlus operations invoke the attacker-controlled ...[truncated 707 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to a specifically reviewed version, for example: ```bash npm install --global --ignore-scripts cloudplus-mcp-server@<reviewed-version> ``` 2. Verify the expected package publisher, registry URL, provenance, and integrity hash before installation. 3. Prefer a project-local, locked dependency over a global installation. 4. Execute the CLI from an isolated environment with narrowly scoped filesystem and network permissions. 5. Disable npm lifecycle scripts unless they are required and have been audited. 6. Require explicit user approval before installing or modifying software. 7. Validate the resolved executable path before invocation so that an unrelated or attacker-controlled binary cannot satisfy the `which` check. 8. Periodically audit the pinned package and update it only after reviewing the new release. ]]>
