T08 · Insecure Dependencies
Error
- Location
- skill.json:26
- Finding
- Unpinned Third-Party npm Package Is Downloaded and Executed Automatically<![CDATA[ ## Vulnerability Details **File Location**: `skill.json:26-31` **Vulnerability Type**: Unpinned and automatically executed third-party dependency **Risk Level**: High ### Vulnerable Code ```json "mcp": { "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], ``` ### Technical Analysis The MCP configuration invokes `npx` with the `-y` option and an npm package name that has no exact version constraint. As a result, npm can retrieve and execute the package version currently resolved by the registry without interactive confirmation. The project contains no lockfile, package integrity hash, or other mechanism that binds execution to an audited package artifact. Consequently, the effective executable payload can change after this skill has been reviewed. Compromise of the package, its maintainer account, the publication pipeline, or the package registry could introduce arbitrary code into subsequent installations. The spawned process receives the configured MCP environment, including `API_KEY` and `AGENTDOCS_URL`. Malicious package code could therefore read those values and act with the operating-system privileges of the user running the skill. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, or its publication pipeline. 2. The attacker publishes a malicious version of `@agentdocs1/mcp-server`. 3. A user installs or starts the skill. 4. `npx -y` resolves the unpinned package without requesting confirmation. 5. The malicious package executes locally under the user's account. 6. The package reads the MCP token and service URL from its environment. 7. The attacker exfiltrates credentials, accesses organizational records using the token, or performs other actions permitted to the local process. ### Impact Assessment Successful exploitation can result in arbitrary local code execution with the privileges of the user running the agent. The malicious process may access the configured U ...[truncated 394 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin `@agentdocs1/mcp-server` to a specific, reviewed version rather than relying on registry resolution of the latest release. - Use a lockfile and verify package integrity hashes during installation. - Remove `-y` so unexpected package retrieval is not silently approved. - Prefer a preinstalled, verified executable or a reproducibly built and signed package. - Monitor the dependency for ownership changes, security advisories, and unexpected releases. - Run the MCP server in a sandbox or container with restricted filesystem and network access. - Supply a short-lived, narrowly scoped API token that cannot administer the UPLO instance or access unrelated datasets. - Prevent child processes and package lifecycle scripts unless they are explicitly required and reviewed. ]]>
