T08 · Insecure Dependencies
- Location
SKILL.md:49- Finding
Unpinned Third-Party Package Is Automatically Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 49-63
Vulnerability Type: Unpinned dependency execution throughnpx
Risk Level: MediumThe documented MCP configuration automatically downloads and executes
@amap/mcp-serverwithout pinning an exact package version:json { "mcpServers": { "amap": { "command": "npx", "args": ["-y", "@amap/mcp-server"], "env": { "AMAP_API_KEY": "Your API key goes here" } } } }Technical Analysis
The command
npx -y @amap/mcp-serverresolves the package from the configured npm registry at execution time. No exact version, lockfile, or integrity hash constrains the downloaded artifact. The-yoption also suppresses the installation confirmation prompt.Consequently, the code that users execute can differ from the code available when the skill was audited. If the package publisher account, package release process, registry, or dependency chain is compromised, a malicious package version could be installed and executed automatically. The MCP process also receives
AMAP_API_KEYthrough its environment, making that credential directly accessible to package code.This is classified as
T08: Insecure Dependenciesbecause the primary weakness is unsafe supply-chain consumption of an unpinned third-party package. The audit found no evidence that the currently referenced package is malicious; the risk arises from automatic execution of mutable, externally supplied code.Attack Path
- An attacker compromises the npm package publisher, release pipeline, registry resolution path, or a transitive dependency used by
@amap/mcp-server. - The attacker publishes or causes resolution to a malicious package version.
- A user copies the documented MCP configuration and starts or restarts the AI assistant.
npx -yresolves and downloads the package without requiring interactive approval.- The down ...[truncated 1183 chars]
- An attacker compromises the npm package publisher, release pipeline, registry resolution path, or a transitive dependency used by
- Remediation
View remediation
Remediation Suggestions
- Pin
@amap/mcp-serverto an exact version that has been reviewed, rather than allowing npm to resolve the latest release:json { "mcpServers": { "amap": { "command": "npx", "args": ["-y", "@amap/mcp-server@<reviewed-exact-version>"], "env": { "AMAP_API_KEY": "Your API key goes here" } } } } - Prefer a controlled installation process backed by a committed lockfile and npm integrity metadata instead of downloading the package dynamically whenever the MCP server starts.
- Verify the package publisher, provenance, signatures or attestations, and dependency tree before approving upgrades.
- Remove
-ywhere operationally feasible so unexpected installation changes require explicit confirmation. - Run the MCP server in a sandbox or dedicated low-privilege account with narrowly scoped filesystem and network access.
- Provide only the required environment variable to the MCP process; do not inherit unrelated secrets from the parent environment.
- Use a dedicated Amap API key with appropriate quota restrictions, monitoring, and rotation procedures.
- Establish a controlled update process in which new versions are reviewed and tested before the pinned version is changed.
- Pin
