T08 · Insecure Dependencies
- Location
SKILL.md:32- Finding
Automatic Execution of an Unpinned Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 32-38
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: Mediumjson { "mcpServers": { "cn-ecommerce-search": { "command": "npx", "args": ["-y", "@shopmeagent/cn-ecommerce-search-mcp"] } } }Technical Analysis
The documented MCP configuration invokes
npxwith the-yoption and a package name that has no exact version constraint. This causes npm to resolve, download, and execute the package version available from the configured registry at invocation time. The-yoption automatically accepts installation prompts.Consequently, the code executed by users can change after the Skill has been reviewed. The configuration also provides no integrity hash or other mechanism for verifying that the downloaded package is the exact artifact that was audited. If the package, its transitive dependencies, its publisher account, or the package registry is compromised, attacker-controlled lifecycle scripts or runtime code could execute locally.
The audited project contains only
SKILL.md; the implementation of@shopmeagent/cn-ecommerce-search-mcpis not included. Therefore, this finding concerns unsafe dependency acquisition and execution rather than evidence that the current package version is malicious.Attack Path
- An attacker compromises the npm publisher account, package release process, registry delivery path, or a transitive dependency associated with
@shopmeagent/cn-ecommerce-search-mcp. - The attacker publishes or causes resolution of a malicious package version.
- A user applies the documented MCP configuration and starts the server.
npx -yresolves and downloads the then-current package without an interactive confirmation or an exact version pin.- Malicious installation lifecycle scripts or package runtime code execute with the permissions of the user running the MC ...[truncated 930 chars]
- An attacker compromises the npm publisher account, package release process, registry delivery path, or a transitive dependency associated with
- Remediation
View remediation
Remediation Suggestions
- Pin the MCP package to a specific, reviewed version, for example:
json { "mcpServers": { "cn-ecommerce-search": { "command": "npx", "args": ["-y", "@shopmeagent/cn-ecommerce-search-mcp@2.0.0"] } } } - Prefer a reproducible installation workflow using a committed lockfile and npm integrity metadata rather than resolving the package dynamically on every invocation.
- Verify package provenance, publisher identity, release signatures or attestations, and dependency contents before approving version updates.
- Review lifecycle scripts and transitive dependencies, and disable installation scripts where they are not required.
- Remove automatic confirmation where practical so unexpected downloads are visible to the operator.
- Run the MCP server in a restricted environment with minimum filesystem permissions, a sanitized environment, no unnecessary credentials, and outbound network access limited to required endpoints.
- Establish a controlled update process in which each new package version is scanned and reviewed before the pinned version is changed.
- Pin the MCP package to a specific, reviewed version, for example:
