CVE-2025-54073
BaseFortify
Publication date: 2025-07-18
Last updated on: 2025-07-22
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| mcp-package-docs | mcp-package-docs | 0.1.27 |
| node-code-sandbox-mcp | node-code-sandbox-mcp | 1.2.0 |
| cyanheads | git-mcp-server | 2.1.4 |
| mcp-server-kubernetes | mcp-server-kubernetes | 2.5.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-77 | The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2025-54073 is a critical command injection vulnerability in the mcp-package-docs MCP Server, which provides large language models (LLMs) with access to package documentation. The vulnerability arises because the server constructs shell commands using unsanitized user input directly within Node.js's child_process.exec function. This allows an attacker to inject arbitrary system commands via shell metacharacters (like |, >, &&), leading to remote code execution with the server process's privileges. For example, the vulnerable function describeGoPackage builds commands like 'go doc ${packageName}' without sanitizing the packageName input, enabling injection. The vulnerability requires user interaction and network access but no privileges. It was fixed by replacing exec with execFile and sanitizing inputs to prevent shell interpretation. [1, 7]
How can this vulnerability impact me? :
This vulnerability can lead to remote code execution (RCE) on the server running the mcp-package-docs MCP Server. An attacker can inject arbitrary system commands that execute with the privileges of the server process, potentially allowing them to read, modify, or delete data, install malware, or take control of the server environment. Exploitation requires user interaction but no special privileges, making it a significant security risk. The impact includes high confidentiality, integrity, and availability damage, as attackers can execute commands remotely and escape sandbox protections. [1, 7, 6]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
Detection of this vulnerability involves monitoring for command injection attempts and suspicious shell command executions originating from the mcp-package-docs MCP Server. Since the vulnerability arises from unsanitized user input passed to shell commands, detection can focus on identifying unusual command executions or creation of unexpected files (e.g., files like /tmp/TEST1 created by injected commands). Automated detection methods include deploying security scanners such as Invariant's MCP-scan in proxy mode to audit MCP interactions in real time and detect potential security violations. Additionally, monitoring logs for execution of commands like `go doc` with suspicious arguments or unexpected shell metacharacters can help identify exploitation attempts. Specific commands to detect exploitation are not provided in the resources, but monitoring for creation of files like `/tmp/TEST1` or unexpected execution of shell commands by the MCP server process can be indicators. [2]
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include upgrading the mcp-package-docs MCP Server to version 0.1.28 or later, which contains the fix replacing unsafe use of child_process.exec with safer execFile calls and input sanitization. Avoid using vulnerable versions (prior to 0.1.27) that execute shell commands with unsanitized input. Additionally, implement input sanitization to remove shell metacharacters from user inputs, and avoid executing shell commands by concatenating strings. Employ runtime security controls such as granular permission restrictions limiting agent access to only necessary repositories and continuous security monitoring with tools like Invariant Guardrails or MCP-scan to detect and prevent command injection attempts. Finally, consider cloning or containerizing the repository rather than using `npx -y` in production to reduce exposure. [1, 2, 7]