NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-34939: PraisonAI Has ReDoS via Unvalidated User-Controlled Regex in MCPToolIndex.search_tools()

mediumCVSS 3.1 6.5GHSA-8w9j-hc3g-3g7f

PraisonAI up to 4.5.89 compiles a caller-supplied string as a Python regex in MCPToolIndex.search_tools(), with no validation or timeout. One crafted pattern such as (a+)+$ stalls the process for hundreds of seconds and takes the service down. Upgrade praisonai to 4.5.90.

Published Apr 1, 2026 · Updated Apr 6, 2026 · Analysis Oct 31, 2026

What an attacker can do

search_tools() in tool_index.py passes the query straight to re.compile(query, re.IGNORECASE) and then runs the pattern against every tool name and hint. A pattern with nested quantifiers causes catastrophic backtracking in Python's re engine. The advisory's proof of concept used a tool named with 30 letters a followed by an exclamation mark and the query (a+)+$. The call took 376 seconds on praisonai 1.5.87 (source install).

The thread is blocked the whole time, so the service is down for every user. The advisory says the MCP server HTTP transport runs without an API key by default. That makes the flaw reachable by any attacker on the network, and repeated requests keep the outage going. The CVSS vector lists low privileges. The result is availability loss only, with no data access or code execution.

Who is affected

pip package praisonai, versions up to and including 4.5.89. The risk is highest for deployments that expose the MCP server HTTP transport without an API key. Check the installed version:

pip show praisonai

praisonai

Ecosystem
PyPI
Affected
<= 4.5.89
Fixed in
4.5.90
Check
pip show praisonai

How to fix it

Upgrade to praisonai 4.5.90 or later:

pip install --upgrade praisonai==4.5.90

The advisory does not describe the code change and lists no workaround. As a stopgap, do not expose the MCP server transport to untrusted networks, and set an API key.

How to tell if you were hit

Look for the PraisonAI process pinned at 100 percent CPU with requests that never return. Check the MCP server request logs for tool search queries with regex syntax such as nested groups with quantifiers, for example (a+)+$. Repeated hangs after search calls point to this flaw.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

MCPToolIndex.search_tools() compiles a caller-supplied string directly as a Python regular expression with no validation, sanitization, or timeout. A crafted regex causes catastrophic backtracking in the re engine, blocking the Python thread for hundreds of seconds and causing a complete service outage.

Details

tool_index.py:365 (source) -> tool_index.py:368 (sink)

# source -- query taken directly from caller, no validation
def search_tools(self, query: str) -> List[ToolInfo]:
    import re

# sink -- compiled and applied with no timeout or exception handling
    pattern = re.compile(query, re.IGNORECASE)
    for tool in self.get_all_tools():
        if pattern.search(tool.name) or pattern.search(tool.hint):
            matches.append(tool)

PoC

# tested on: praisonai==1.5.87 (source install)
# install: pip install -e src/praisonai
import sys, time, json
sys.path.insert(0, 'src/praisonai')
from pathlib import Path

mcp_dir = Path.home() / '.praison' / 'mcp' / 'servers' / 'test_server'
mcp_dir.mkdir(parents=True, exist_ok=True)
(mcp_dir / '_index.json').write_text(json.dumps([
    {"name": "a" * 30 + "!", "hint": "a" * 30 + "!", "server": "test_server"}
]))
(mcp_dir / '_status.json').write_text(json.dumps({
    "server": "test_server", "available": True, "auth_required": False,
    "last_sync": time.time(), "tool_count": 1, "error": None
}))

from praisonai.mcp_server.tool_index import MCPToolIndex
index = MCPToolIndex()

start = time.monotonic()
results = index.search_tools("(a+)+$")
print(f"Returned in {time.monotonic() - start:.1f}s")
# expected output: Returned in 376.0s

Impact

A single crafted query blocks the Python thread for hundreds of seconds, causing a complete service outage for the duration. The MCP server HTTP transport runs without an API key by default, making this reachable by any attacker on the network. Repeated requests sustain the DoS indefinitely.

Credited to YeranG30.

Questions

Does CVE-2026-34939 need authentication?

The advisory says the MCP server HTTP transport runs without an API key by default, so any attacker on the network can reach it. The CVSS vector lists low privileges.

Can it lead to code execution?

No. The impact is availability only. A crafted regex blocks the Python thread for hundreds of seconds.

Which version fixes it?

praisonai 4.5.90. Versions up to and including 4.5.89 are affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries