Quadratic WebSocket fragment reassembly causes CPU denial of service
- CVE-2026-132651
- GHSA-4p8q-h859-jh8m
- EUVD-2026-144127
Description
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 max_message_size_bytes 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 max_message_size_bytes small and connect only to trusted wss:// endpoints.
Text from the CVE.org record.
Recommendation
pydantic httpx2
- If you run a version from 2.6.0 to before 2.18.0update to 2.18.0 or laterMinor version change: check the release notes
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
pydantic httpx2
Affected versions Fixed in from 2.6.0 to before 2.18.0 2.18.0
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.