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

CVE-2026-10692: code-index-mcp DoS Vulnerability

CVE-2026-10692 is a denial of service vulnerability in johnhuang316 code-index-mcp caused by inefficient regex complexity. Attackers can exploit this remotely via regex manipulation. This article covers technical details, affected versions, and mitigation strategies.

Published:

CVE-2026-10692 Overview

CVE-2026-10692 affects johnhuang316/code-index-mcp versions up to and including 2.14.0. The flaw resides in the is_safe_regex_pattern function within the search_code_advanced component. An attacker can manipulate the regex argument to trigger inefficient regular expression complexity, resulting in a Regular Expression Denial of Service (ReDoS) condition [CWE-400]. The attack is launched remotely and requires only low-privilege access. A public proof-of-concept is available, and the maintainer has released version 2.14.1 containing the fix.

Critical Impact

Authenticated remote attackers can submit crafted regex patterns to exhaust CPU resources on the host running code-index-mcp, degrading availability of the indexing service.

Affected Products

  • johnhuang316 code-index-mcp versions up to and including 2.14.0
  • Component: search_code_advanced
  • Function: is_safe_regex_pattern

Discovery Timeline

  • 2026-06-03 - CVE-2026-10692 published to NVD
  • 2026-06-04 - Last updated in NVD database
  • Patch commit - 25bc02fac74051ddae15ce79e952f00211b1ea6b released in version 2.14.1

Technical Details for CVE-2026-10692

Vulnerability Analysis

The vulnerability is an algorithmic complexity issue in the is_safe_regex_pattern validator used by the search_code_advanced feature of code-index-mcp. This function is intended to determine whether a user-supplied regular expression is safe to execute against indexed code. The validation logic itself, or the regex engine that subsequently consumes the pattern, exhibits catastrophic backtracking on adversarial inputs. The result is excessive CPU consumption that blocks request processing.

Because code-index-mcp is a Model Context Protocol (MCP) server that exposes code search to AI agents and developer tooling, the vulnerable endpoint is typically reachable from any client authorized to issue search queries. The EPSS probability for this issue is 0.045% (percentile 14.346), reflecting limited active exploitation interest despite a public exploit.

Root Cause

The is_safe_regex_pattern function fails to reject patterns that produce exponential or polynomial backtracking. Patterns containing nested quantifiers, overlapping alternations, or repeated optional groups bypass the safety check and reach the underlying regex engine. The engine then evaluates the pattern against indexed source files, consuming CPU time proportional to the adversarial pattern's complexity.

Attack Vector

An attacker with the ability to call search_code_advanced submits a crafted regex argument. The pattern passes the is_safe_regex_pattern check but triggers catastrophic backtracking during evaluation. Repeated requests amplify the denial-of-service condition against the indexing host. No authentication uplift or user interaction is required beyond standard low-privilege access to the MCP endpoint.

A proof-of-concept is published on the project's GitHub issue tracker. See the GitHub Issue Tracker and the VulDB CVE Details for technical specifics. No verified exploit code is reproduced here.

Detection Methods for CVE-2026-10692

Indicators of Compromise

  • Sustained high CPU utilization tied to the code-index-mcp process without a corresponding increase in indexed content.
  • Long-running or stalled search_code_advanced requests originating from a single client or session.
  • Repeated regex queries containing nested quantifiers such as (a+)+, (.*)*, or overlapping alternations targeting the /search interface.

Detection Strategies

  • Instrument the MCP server to log the regex argument, source identity, and execution time for each search_code_advanced invocation.
  • Apply timeout-based anomaly detection to flag requests exceeding a baseline execution threshold.
  • Use static regex analyzers to scan submitted patterns for known ReDoS constructs prior to evaluation.

Monitoring Recommendations

  • Track per-client request rates and CPU time consumed by the indexing service.
  • Alert on repeated regex queries that hit configured execution timeouts.
  • Forward MCP server logs to a centralized analytics platform for correlation with host resource metrics.

How to Mitigate CVE-2026-10692

Immediate Actions Required

  • Upgrade code-index-mcp to version 2.14.1 or later, which includes patch commit 25bc02fac74051ddae15ce79e952f00211b1ea6b.
  • Restrict access to the MCP server to trusted developer tooling and authenticated agents only.
  • Enforce execution timeouts on regex evaluation paths to bound worst-case CPU usage.

Patch Information

The maintainer addressed the issue in version 2.14.1. The fix is published as commit 25bc02fac74051ddae15ce79e952f00211b1ea6b. See the GitHub Commit Details and the GitHub Release Notes for full change context.

Workarounds

  • Place the MCP server behind an authenticating reverse proxy and restrict which clients may invoke search_code_advanced.
  • Enforce a maximum regex pattern length and reject patterns containing known catastrophic constructs.
  • Run code-index-mcp under a process-level CPU and time limit (for example, ulimit -t or container resource constraints) to contain ReDoS impact.
bash
# Configuration example: upgrade and constrain the service
pip install --upgrade code-index-mcp==2.14.1

# Example systemd hardening to cap CPU usage per process
# /etc/systemd/system/code-index-mcp.service.d/limits.conf
[Service]
CPUQuota=50%
MemoryMax=1G
TimeoutStartSec=30

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.