CVE-2026-84378: HTTPX2: Quadratic SSE line buffering can cause CPU denial of service
Summary HTTPX2's Server-Sent Events (SSE) parser repeatedly copied and rescanned buffered text when a server split one unterminated line across many response chunks. The total work grows quadratically with the length of the line. An attacker-controlled or compromised SSE endpoint can exploit this behavior to consume excessive client CPU.
Published Sep 8, 2026
Affected packages
httpx2
- Ecosystem
- PyPI
- Affected
- >= 2.5.0, < 2.10.0
- Fixed in
- 2.10.0
- Check
pip show httpx2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
HTTPX2's Server-Sent Events (SSE) parser repeatedly copied and rescanned buffered text when a server split one unterminated line across many response chunks. The total work grows quadratically with the length of the line. An attacker-controlled or compromised SSE endpoint can exploit this behavior to consume excessive client CPU.
Details
Before version 2.10.0, HTTPX2 combined the complete pending SSE line with each newly received chunk and then scanned the combined text for line separators. If an SSE server sends a long line as many small chunks without a line separator, every chunk causes all previously received text to be copied and scanned again. For n fixed-size chunks, this results in O(n²) processing.
The behavior affects both httpx2.Client.sse() and httpx2.AsyncClient.sse(). Other response APIs do not use the SSE parsing path.
Impact
Applications that consume SSE from an attacker-controlled or compromised endpoint can experience excessive CPU usage. A crafted stream can block a synchronous worker or the asynchronous event loop that is consuming it, degrading availability for other work in that process. Confidentiality and integrity are not affected.
Mitigation
Upgrade to HTTPX2 2.10.0 or later. SSE parsing now accumulates incomplete line fragments and combines them only when necessary, making processing linear in the amount of received data. HTTPX2 2.10.0 also limits buffered SSE events to 1 MiB by default through max_event_size.
If upgrading is not immediately possible, only consume SSE from trusted endpoints and enforce an external size or time budget on the stream.
Credited to GalaxySnail.
References
- https://github.com/pydantic/httpx2/security/advisories/GHSA-f2fp-rgf2-35cp
- https://nvd.nist.gov/vuln/detail/CVE-2026-84378
- https://github.com/pydantic/httpx2/pull/1071
- https://github.com/pydantic/httpx2/pull/1117
- https://github.com/pydantic/httpx2/commit/cbfc0e04ef6507da29ccbb3b9c2e5b23dd693414
- https://github.com/pydantic/httpx2/releases/tag/v2.10.0
- https://github.com/advisories/GHSA-f2fp-rgf2-35cp
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-84379
HTTPX2: Multipart part header injection via unvalidated file Content-Type and custom headers
medium5.3Sep 8, 2026CVE-2026-84380
HTTPX2: Conflicting Content-Length and Transfer-Encoding headers can be auto-generated
medium5.6Sep 8, 2026CVE-2026-84381
HTTPX2: Secure WebSocket traffic sent without TLS through SOCKS proxies
high8.1Sep 8, 2026CVE-2026-84382
HTTPX2: Streaming response decompression does not bound peak memory (decompression amplification)
high7.5Sep 8, 2026
