T08 · Insecure Dependencies
- Location
SKILL.md:45- Finding
Unpinned npm Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 45–46
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable code snippet:
json { "mcpServers": { "agent-reader": { "command": "npx", "args": ["-y", "agent-reader", "mcp"] } } }Technical Analysis
The documented MCP configuration executes the
agent-readernpm package by name without specifying an exact version or verifying package integrity. Consequently,npxresolves the package version from the configured npm registry at execution time. The-yoption suppresses the package-installation confirmation prompt.This creates a supply-chain trust boundary in which the code ultimately executed can change after the skill has been reviewed. If the npm package, its maintainer account, a transitive dependency, or the configured registry is compromised, a future invocation could download and execute attacker-controlled code. The package would execute with the operating-system permissions and environment inherited from the MCP host.
The repository does provide an npm link, but it does not include a lockfile, integrity hash, exact package version, or other mechanism that binds installation to reviewed artifacts.
Attack Path
- A user copies the documented MCP configuration into an agent host.
- An attacker compromises the
agent-readernpm package, its publisher account, one of its dependencies, or the package registry used by the victim. - The attacker publishes a malicious version that still resolves under the unversioned package name.
- The MCP host starts the server using
npx -y agent-reader mcp. npxretrieves the currently resolved package without an interactive confirmation prompt.- Malicious package installation hooks or runtime code execute under the MCP host user's account.
Impact Assessment
Successful exploitation could provide arbi ...[truncated 570 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the package to a specific reviewed version, for example:
json { "command": "npx", "args": ["-y", "agent-reader@1.3.7", "mcp"] } -
Prefer installing from a lockfile-controlled project using
npm ci, with the lockfile committed and reviewed. -
Verify package integrity using npm lockfile integrity metadata or a separately maintained cryptographic digest.
-
Review and monitor direct and transitive dependencies for unexpected ownership, release, and lifecycle-script changes.
-
Avoid automatic remote installation during routine MCP startup. Install the audited artifact in a controlled deployment step and execute the local pinned binary.
-
Run the MCP server under a dedicated, least-privileged account or sandbox with restricted filesystem, environment-variable, process, and network access.
-
Consider disabling lifecycle scripts during installation where compatible, and permit only explicitly reviewed scripts.
-
