/

CVE-2026-26015

Severity:

CRITICAL RISK

(9.8)

Command Injection in DocsGPT MCP Test Handling

CVE-2026-26015

Modified

Vulnerability type

Category:

Command Injection

CWE:

CWE-77

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

DocsGPT, a GPT-powered documentation chat system, contains a command injection flaw that allows attackers to bypass the "MCP test" behavior and trigger arbitrary command execution on the underlying host.

Any user who can interact with a vulnerable DocsGPT instance (official site or local/public deployments) may be able to send crafted payloads that result in remote code execution (RCE) on the server.

Affected context

The vulnerability appears in DocsGPT deployments between versions 0.15.0 and 0.16.0 where the "MCP test" behavior interacts with the system environment or tools in a way that can be influenced by user-provided data.

It primarily affects contexts where:

  • User prompts or payloads are transformed into commands or tool invocations.
  • The "MCP test" logic is intended to constrain or validate tool usage but does not fully sanitize inputs.
  • DocsGPT is exposed over the network (official cloud instance, public demo, or self-hosted installation) and accessible to untrusted users.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the DocsGPT application (web UI, API endpoints, or chatbot interface).
  • Required access: Ability to send crafted requests or chat prompts to a vulnerable DocsGPT instance; no special privileges are implied.
  • Trigger point: The path where DocsGPT processes the "MCP test" behavior and forwards or embeds user-controlled data into command execution or tool integration.
  • Why exploitation is possible: User-controlled content can bypass the intended MCP safeguard logic and reach a command execution sink without robust validation or escaping, enabling shell metacharacters or command fragments to be interpreted by the operating system.

Why this happens

This issue stems from unsafe handling of user-controlled data in a code path associated with the "MCP test" behavior.

Instead of strictly treating user input as data and constraining it by a fixed schema or parameter set, the application allows portions of the prompt or payload to influence command strings or execution parameters.

This pattern maps directly to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where delimiters and shell metacharacters are not adequately escaped or filtered before reaching a command interpreter or equivalent execution environment.

Potential impact

  • Remote execution of arbitrary OS commands with the privileges of the DocsGPT process.
  • Reading, modifying, or deleting files accessible to the DocsGPT runtime.
  • Exfiltration of sensitive configuration data, environment variables, or credentials.
  • Lateral movement to other systems if the host has additional network access or trust relationships.
  • Complete compromise of the DocsGPT deployment, including stored logs or documents.

General mitigation guidance

Mitigation typically focuses on eliminating the ability of user input to shape commands and enforcing strict boundaries around tool and system interaction.

Recommended defensive patterns include:

  • Using high-level, parameterized APIs instead of building command strings; avoid direct shell invocation where possible.
  • Constraining the "MCP test" and similar behaviors to a fixed, declarative set of operations that do not accept arbitrary user-supplied fragments.
  • Applying rigorous input validation and canonicalization, rejecting inputs that do not match expected formats, types, or enumerated values.
  • Running DocsGPT and any associated tools under least-privilege accounts and within sandboxed or containerized environments to limit blast radius.
  • Separating untrusted user input from control channels; treat prompts as data that cannot directly influence file paths, flags, or interpreter directives.

How teams detect issues like this

Effective detection blends code-level analysis with behavioral monitoring:

  • Static analysis: Search for functions that invoke shells or external tools (e.g., exec, spawn, command-line wrappers) where arguments incorporate user-controlled content related to MCP or test flows.
  • Code review: Flag patterns where prompt text, request bodies, or chat messages are concatenated into command strings, environment variables, or tool arguments without strict whitelisting.
  • Policy enforcement: Introduce secure coding standards that prohibit shell command construction from user input and require parameterized or API-based interactions for all tool calls.
  • Runtime observation: Monitor for unusual command patterns originating from DocsGPT processes, such as unexpected binaries being launched or anomalous argument combinations.

Automated SAST and code scanning tools can assist by highlighting command execution sinks and tainted data flows for closer manual inspection.

Sources

SourceLink
github.comgithub.com/arc53/DocsGPT/releases/tag/0.16.0
github.comgithub.com/arc53/DocsGPT/security/advisories/GHSA-gcrq-f296-2j74
ox.securityox.security/blog/mcp-supply-chain-advisory-rce-vulnerabilities-across-the-ai-ecosystem/
ox.securityox.security/blog/the-mother-of-all-ai-supply-chains-critical-systemic-vulnerability-at-the-core-of-the-mcp/

Frequently asked

questions

Yes. Any attacker who can interact with a vulnerable DocsGPT instance over the network can potentially exploit this issue by sending crafted prompts or API requests, without needing local access.

The attacker generally needs only the same level of access as a regular user of the DocsGPT interface. There is no inherent requirement for prior authentication or elevated privileges, though deployment-specific access controls may provide some protection.

The safest approach is to remove or refactor any code paths where user input can influence command execution. Replace shell-based operations with parameterized library calls, enforce strict whitelists for operations performed during MCP tests, and ensure that user content is never interpolated into command strings.

Adopt a design principle that treats all user input as untrusted and incapable of controlling execution paths. Use parameterized APIs for system interactions, define clear schemas and constraints for tool and plugin requests, enforce secure coding guidelines in reviews, and employ automated scanning to catch command injection patterns early in development.

Find out what's already
exploitable in your codebase.