T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:45
- Finding
- Unpinned npm Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, lines 45–46 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium **Vulnerable code snippet**: ```json { "mcpServers": { "agent-reader": { "command": "npx", "args": ["-y", "agent-reader", "mcp"] } } } ``` ### Technical Analysis The documented MCP configuration executes the `agent-reader` npm package by name without specifying an exact version or verifying package integrity. Consequently, `npx` resolves the package version from the configured npm registry at execution time. The `-y` option 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 1. A user copies the documented MCP configuration into an agent host. 2. An attacker compromises the `agent-reader` npm package, its publisher account, one of its dependencies, or the package registry used by the victim. 3. The attacker publishes a malicious version that still resolves under the unversioned package name. 4. The MCP host starts the server using `npx -y agent-reader mcp`. 5. `npx` retrieves the currently resolved package without an interactive confirmation prompt. 6. 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
- ## 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.
