T08 · Insecure Dependencies
- Location
SKILL.md:140- Finding
Unpinned Third-Party Package Execution via npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 140–145
Vulnerability Type: Unpinned and automatically downloaded third-party dependency
Risk Level: MediumVulnerable Code
json { "mcpServers": { "mcp-diagram-generator": { "command": "npx", "args": ["-y", "mcp-diagram-generator"] } } }The same unsafe command is recommended again in the configuration guidance at lines 278–282:
text A: Add an `mcp-diagram-generator` entry to the Agent's MCP configuration, set `command` to `npx`, and set `args` to `["-y", "mcp-diagram-generator"]`.Technical Analysis
The skill directs users to execute
mcp-diagram-generatorthroughnpxwithout pinning an exact package version or verifying its integrity. Consequently, package resolution may select a newer release than the one reviewed when the skill was published.The
-yoption automatically accepts installation, removing the interactive confirmation that would otherwise alert the user that external package code is being downloaded and executed. npm packages can execute lifecycle scripts during installation, and the resulting MCP server itself runs as executable code. Therefore, compromise of the package, its publication account, or its transitive dependencies could result in arbitrary code execution.This finding does not establish that the named package is currently malicious. The vulnerability is the unsafe dependency acquisition and execution model documented by the skill.
Attack Path
- An attacker compromises the package publication account, a transitive dependency, or the relevant package supply chain.
- The attacker publishes a malicious version under the package name used by the skill.
- A user follows the documented configuration and starts the MCP server with
npx -y mcp-diagram-generator. npxresolves and downloads the unpinned package without requesting installation confirmation.- Malicious lifecycle or server code executes ...[truncated 832 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the dependency to a reviewed exact version, for example:
json { "mcpServers": { "mcp-diagram-generator": { "command": "npx", "args": ["--yes", "mcp-diagram-generator@1.2.3"] } } } -
Prefer a locally installed dependency governed by a committed lockfile rather than downloading executable code when the MCP server starts.
-
Verify package provenance and integrity, including the official registry, publisher identity, release signatures or attestations where available, and expected package hashes.
-
Review both direct and transitive dependencies before approving upgrades. Use automated dependency and lockfile scanning in the release process.
-
Avoid silent installation where practical. If
npxremains necessary, use controls that prevent unexpected version changes and registry substitution. -
Run the MCP server in a sandbox or container with:
- A minimal environment and no unrelated secrets.
- Write access restricted to the intended diagram output directory.
- Read access restricted to required project data.
- Network access disabled or allowlisted when not required.
- A dedicated unprivileged operating-system identity.
-
Document a trusted package source and a controlled upgrade procedure so reviewed versions are changed deliberately rather than resolved dynamically.
-
