CVE-2025-54073
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-07-18

Last updated on: 2025-07-22

Assigner: GitHub, Inc.

Description
mcp-package-docs is an MCP (Model Context Protocol) server that provides LLMs with efficient access to package documentation across multiple programming languages and language server protocol (LSP) capabilities. A command injection vulnerability exists in the `mcp-package-docs` MCP Server prior to the fix in commit cb4ad49615275379fd6f2f1cf1ec4731eec56eb9. The vulnerability is caused by the unsanitized use of input parameters within a call to `child_process.exec`, enabling an attacker to inject arbitrary system commands. Successful exploitation can lead to remote code execution under the server process's privileges. The server constructs and executes shell commands using unvalidated user input directly within command-line strings. This introduces the possibility of shell metacharacter injection (`|`, `>`, `&&`, etc.). Commit cb4ad49615275379fd6f2f1cf1ec4731eec56eb9 in version 0.1.27 contains a fix for the issue, but upgrading to 0.1.28 is recommended.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-07-18
Last Modified
2025-07-22
Generated
2026-05-07
AI Q&A
2025-07-18
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 4 associated CPEs
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
CWE Icon
KEV
KEV Icon
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]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart