T03 · Remote Payload Retrieval and Execution
Error
- Location
- skill.json:25
- Finding
- Unpinned Remote Package Download and Execution<![CDATA[ ## Vulnerability Details **File Location**: `skill.json:25-29` and `README.md:17-31` **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: High ### Vulnerable Code From `skill.json:25-29`: ```json "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], ``` The corresponding installation example in `README.md:17-31` is: ```json { "mcpServers": { "uplo-cybersecurity": { "command": "npx", "args": ["-y", "@agentdocs1/mcp-server", "--http"], "env": { "AGENTDOCS_URL": "https://your-instance.uplo.ai", "API_KEY": "your-api-key", "DEFAULT_PACKS": "cybersecurity" } } } } ``` ### Technical Analysis The skill launches `@agentdocs1/mcp-server` through `npx -y` without specifying an exact package version or verifying an integrity hash. When the package is absent from the local cache, `npx` may retrieve it from the configured npm registry. The `-y` option automatically accepts the installation prompt. Consequently, the code executed when the skill starts is not immutable and can change after the skill itself has been audited. A compromised npm publisher account, package registry, package release process, or malicious future release could introduce arbitrary code without requiring any modification to this repository. The child process receives the `API_KEY` and `AGENTDOCS_URL` environment variables configured in `skill.json:30-34`. Any code running inside the downloaded package can read those values. It also executes with the operating-system privileges of the application launching the MCP server. ### Attack Path 1. An attacker compromises the npm publisher account, release pipeline, or distribution channel for `@agentdocs1/mcp-server`. 2. The attacker publishes a malicious version under the same package name. 3. A user installs or starts this skill. 4. `npx -y @agentdocs1/mcp-server --http` resolves and downloads the malicious version automatically. ...[truncated 1217 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to a specific, reviewed version, for example: ```json "args": [ "-y", "@agentdocs1/mcp-server@1.2.3", "--http" ] ``` 2. Prefer installing dependencies through a committed lockfile that records package integrity hashes rather than downloading the package dynamically on every launch. 3. Verify the package provenance and signature where supported, and restrict installation to a trusted registry. 4. Remove automatic installation consent where operationally practical. Require an explicit installation or upgrade step before runtime. 5. Run the MCP server in a sandbox or container with: - A read-only filesystem where possible. - No access to unrelated host files or environment variables. - Restricted outbound network access. - A non-privileged operating-system identity. 6. Issue a narrowly scoped API token dedicated to this skill. Do not reuse administrative or general-purpose credentials. 7. Establish a controlled dependency-update process that includes code review, vulnerability scanning, integrity verification, and regression testing before changing the pinned version. ]]>
