Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-10691

CVE-2026-10691: DesktopCommanderMCP RCE Vulnerability

CVE-2026-10691 is a remote code execution vulnerability in DesktopCommanderMCP affecting versions up to 0.2.38. It exploits inefficient regex complexity in search-manager.ts. This article covers technical details, impact, and upgrade.

Published:

CVE-2026-10691 Overview

CVE-2026-10691 is a Regular Expression Denial of Service (ReDoS) vulnerability affecting wonderwhy-er DesktopCommanderMCP versions up to 0.2.38. The flaw resides in the start_search component, specifically within the src/search-manager.ts file. Manipulating the SearchResult[] argument triggers inefficient regular expression complexity, leading to resource exhaustion [CWE-400]. The attack can be initiated remotely by an authenticated user with low privileges. A public exploit has been released, and version 0.2.39 contains the fix delivered via patch commit 4ce845f8749b6a159b57b38dcc3357f7222a8078.

Critical Impact

Remote attackers can submit crafted regex patterns that trigger catastrophic backtracking, consuming CPU resources and degrading availability of the DesktopCommanderMCP service.

Affected Products

  • wonderwhy-er DesktopCommanderMCP versions up to and including 0.2.38
  • Component: start_search in src/search-manager.ts
  • Fixed in: DesktopCommanderMCP 0.2.39

Discovery Timeline

  • 2026-06-03 - CVE CVE-2026-10691 published to NVD
  • 2026-06-03 - Last updated in NVD database

Technical Details for CVE-2026-10691

Vulnerability Analysis

The vulnerability is a ReDoS condition in the DesktopCommanderMCP search functionality. DesktopCommanderMCP is a Model Context Protocol (MCP) server that exposes desktop file and search operations to AI agents. The start_search handler accepts regex patterns and applies them against file content, including Excel and DOCX documents.

When a caller supplies a pattern containing nested quantifiers or overlapping alternations, the JavaScript regex engine performs catastrophic backtracking. Even modestly sized inputs can cause execution time to grow exponentially, blocking the Node.js event loop and starving other requests.

The issue is classified under [CWE-400] (Uncontrolled Resource Consumption). The EPSS probability is 0.06% (19th percentile), reflecting limited observed exploitation despite public exploit availability.

Root Cause

The search-manager.ts module compiled user-supplied search strings directly into RegExp objects without validating their structural safety. Patterns such as (a+)+, (a*)*, or (\w|\d)+ produce ambiguous match paths that the regex engine explores exhaustively on failure, resulting in exponential time complexity.

Attack Vector

A remote authenticated user invokes the start_search tool with a malicious regex pattern targeting content within a workspace file. The MCP server compiles the pattern and applies it against file contents, triggering CPU exhaustion. No special privileges beyond standard tool invocation are required.

typescript
 import { isExcelFile } from './utils/files/index.js';
 import PizZip from 'pizzip';
 
+/**
+ * Check if a regex pattern is safe from catastrophic backtracking (ReDoS).
+ * Rejects patterns with nested quantifiers like (a+)+, (a*)+, (a+)*, (a*)*,
+ * and similar constructs that cause exponential runtime.
+ */
+export function isSafeRegex(pattern: string): boolean {
+  // Detect nested quantifiers: a group containing a quantifier, followed by a quantifier
+  // Matches patterns like (a+)+, (a+)*, (a*)+, (a*)*,  (?:a+)+, etc.
+  // Also catches {n,m} style quantifiers nested inside quantified groups
+  const nestedQuantifier = /([^\\]|^)\((?:[^)]*[+*}])\s*\)[+*?]|\((?:[^)]*[+*}])\s*\)\{/;
+  if (nestedQuantifier.test(pattern)) {
+    return false;
+  }
+
+  // Detect overlapping alternations in quantified groups: (a|a)+, (\w|\d)+
+  // These can also cause catastrophic backtracking
+  const overlappingAlt = /\((?:[^)]*\|[^)]*)\)[+*]\s*[+*?{]/;
+  if (overlappingAlt.test(pattern)) {
+    return false;
+  }
+
+  return true;
+}

Source: GitHub Commit 4ce845f

Detection Methods for CVE-2026-10691

Indicators of Compromise

  • Sustained 100% CPU utilization by Node.js processes hosting DesktopCommanderMCP
  • Hanging or unresponsive start_search tool invocations from connected MCP clients
  • Search requests containing regex patterns with nested quantifiers such as (a+)+, (a*)*, or overlapping alternations like (\w|\d)+

Detection Strategies

  • Inspect MCP request logs for start_search calls carrying regex patterns matching nested quantifier signatures
  • Monitor process-level CPU time and event loop lag on hosts running DesktopCommanderMCP
  • Correlate spikes in CPU usage with concurrent search requests from a single MCP session

Monitoring Recommendations

  • Enable structured logging for all MCP tool invocations including the raw pattern argument
  • Set per-request execution timeouts and alert on searches exceeding expected runtime
  • Track installed DesktopCommanderMCP versions across developer endpoints to confirm patch deployment

How to Mitigate CVE-2026-10691

Immediate Actions Required

  • Upgrade DesktopCommanderMCP to version 0.2.39 or later, which includes patch commit 4ce845f8749b6a159b57b38dcc3357f7222a8078
  • Audit all hosts and developer workstations running DesktopCommanderMCP and inventory installed versions
  • Restrict access to the MCP server to trusted local clients until the patch is applied

Patch Information

The maintainer released DesktopCommanderMCP v0.2.39 containing the fix. The patch introduces an isSafeRegex() validator in src/search-manager.ts that rejects nested quantifiers and overlapping alternations before pattern compilation. Review the GitHub Pull Request #400 and Issue #375 for implementation context.

Workarounds

  • Apply the isSafeRegex() validation logic from the upstream patch as a local backport if upgrading is blocked
  • Wrap regex execution in a worker thread with a hard timeout to abort runaway matches
  • Restrict the MCP server to listen on localhost interfaces only, limiting remote invocation
bash
# Upgrade DesktopCommanderMCP via npm
npm install -g @wonderwhy-er/desktop-commander@0.2.39

# Verify installed version
npm list -g @wonderwhy-er/desktop-commander

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.