T08 · Insecure Dependencies
Warning
- Location
- skill.json:24
- Finding
- Unpinned Third-Party Package Is Automatically Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `skill.json:24-29` **Additional Location**: `README.md:20-29` **Vulnerability Type**: Supply-chain exposure through an unpinned npm dependency **Risk Level**: Medium ### Vulnerable Code ```json "mcp": { "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], ``` The same unsafe installation pattern is documented in `README.md`: ```json { "mcpServers": { "uplo-accounting": { "command": "npx", "args": ["-y", "@agentdocs1/mcp-server", "--http"], "env": { "AGENTDOCS_URL": "https://your-instance.uplo.ai", "API_KEY": "your-api-key", "DEFAULT_PACKS": "accounting" } } } } ``` ### Technical Analysis The MCP server is launched with `npx -y @agentdocs1/mcp-server` without an exact package version or integrity hash. The `-y` option suppresses installation confirmation, so npm can automatically retrieve and execute whichever package version the registry currently resolves. The reviewed project does not contain the package source, a lockfile, or an integrity record. Consequently, the effective executable payload may change after this Skill has been reviewed. npm lifecycle scripts may also execute during installation. A compromised publisher account, malicious future release, or registry-level supply-chain incident could therefore introduce arbitrary code. The configured `API_KEY` is supplied directly to the downloaded process as an environment variable. A malicious package version could read and exfiltrate that credential, as well as access other resources available to the MCP process. ### Attack Path 1. An attacker compromises the npm publisher account, package distribution pipeline, or a future release of `@agentdocs1/mcp-server`. 2. The attacker publishes a malicious version under the same package name. 3. A user installs or starts the Skill. 4. `npx -y` resolves and downloads the malicious current version without ...[truncated 907 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@agentdocs1/mcp-server` to an exact, reviewed version rather than relying on the latest registry resolution. 2. Use a lockfile and verify the package integrity hash before execution. 3. Prefer a locally installed, reviewed dependency over downloading it dynamically with `npx`. 4. Avoid `npx -y` for security-sensitive runtime components. 5. Disable npm lifecycle scripts where they are not required. 6. Run the MCP server in a sandbox or container with: - A read-only filesystem where possible. - No access to unrelated user files. - Restricted outbound network access. - A dedicated, unprivileged operating-system account. 7. Issue a narrowly scoped API token and rotate it periodically. 8. Monitor dependency ownership, release provenance, and published package checksums. ]]>
