CVE-2026-132651: Quadratic WebSocket fragment reassembly causes CPU denial of service
httpx2 reassembled fragmented WebSocket messages by appending each continuation frame to a bytes buffer, copying the whole accumulated message on every frame. A WebSocket server, or an on-path attacker on an unencrypted ws:// connection, can split messages into many tiny continuation frames so that reassembly takes time quadratic in the number of frames. Reassembly holds the GIL in the synchronous client and blocks the event loop in the asynchronous client.
Applications are affected when they open a WebSocket session with client.websocket() or httpx2.websocket() to an untrusted endpoint, using httpx2 from 2.6.0 up to (but excluding) 2.18.0. From 2.10.0, the default maxmessagesizebytes limit of 64 KiB bounds the work per message, so sustained load needs many messages; versions 2.6.0 to 2.9.1 have no such limit.
The issue is fixed in 2.18.0, which collects fragments in a list and joins them once when the final frame arrives. Until then, keep maxmessagesizebytes small and connect only to trusted wss:// endpoints.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.18.0 - Configuration
Keep max_message_size_bytes small until upgrading.
httpx2 max_message_size_bytes = small - Compensating control
Connect only to trusted wss:// endpoints until upgrading.
Event History
Frequently Asked Questions
Which deployments are exposed to this denial-of-service condition?
Applications using httpx2 WebSocket sessions via client.websocket() or httpx2.websocket() to reach untrusted endpoints are affected in versions 2.6.0 through 2.17.x. A malicious WebSocket server can trigger it; an on-path attacker can do so when the connection uses unencrypted ws://.
How does the default message-size limit affect exposure?
From version 2.10.0, the default max_message_size_bytes limit is 64 KiB, which bounds work for an individual message, although sustained load can still be created with many messages. Versions 2.6.0 through 2.9.1 have no such limit.
What can be done if upgrading to 2.18.0 is not immediately possible?
Keep max_message_size_bytes small and restrict WebSocket connections to trusted wss:// endpoints. This reduces the work an attacker can force per message and prevents on-path manipulation possible with ws://.
What is the operational impact for synchronous and asynchronous clients?
In the synchronous client, fragment reassembly holds the GIL. In the asynchronous client, it blocks the event loop, so affected processing can delay other application work.