CVE-2026-142020
MediumCVSS 5.9Exploitation Probability (EPSS)
Low risk44th percentile - higher than 44% of all known CVEs
Summary
In httpx2, Response.iter_lines() and Response.aiter_lines() buffered decoded text without any limit on line length. A server can return a small compressed body that decompresses to a large payload with no line separators, causing the client to hold the whole decompressed payload in memory and memory to grow linearly with decompressed size.
Risk Assessment
Applications streaming responses from an untrusted origin with iter_lines() or aiter_lines() can be forced into memory exhaustion, leading to denial of service. The issue affects httpx2 before 2.18.0.
Recommendation
Update httpx2 to version 2.18.0 or later, which limits a buffered line to 1,048,576 characters by default. Until then, use iter_bytes()/aiter_bytes() with a size limit or request Accept-Encoding: identity.
Other vulnerabilities in httpx2
See all- CVE-2026-140868Low
In the httpx2 library (versions before 2.18.0), when following a redirect to a different origin, the Authorization and Cookie headers are removed but Proxy-Authorization is kept. A client that sets Proxy-Authorization in its headers sends that credential to the redirect target, where an attacker can capture it.
- CVE-2026-132651Medium
The httpx2 library (versions 2.6.0 up to but excluding 2.18.0) reassembled fragmented WebSocket messages by copying the whole accumulated buffer on every continuation frame, leading to quadratic complexity. A WebSocket server or on-path attacker can split a message into many tiny frames, blocking the GIL in the synchronous client or the event loop in the asynchronous client.
- CVE-2026-84382High
HTTPX2 before version 2.12.0 fully inflates each gzip, deflate, br, or zstd network chunk before yielding bounded pieces to the application. A 64 KiB compressed chunk can expand to approximately 64 MiB in one intermediate allocation, causing severe memory pressure or out-of-memory termination even when streaming. Fixed in version 2.12.0.
- CVE-2026-84381High
HTTPX2 before 2.10.0 fails to start TLS when using SOCKS5 proxy for wss origins because the TLS upgrade condition only recognizes https. HTTPX2 exposes this via Client.websocket() and AsyncClient.websocket() from 2.6.0 to 2.9.1, allowing plaintext transmission without certificate verification. Fixed in httpcore2 2.10.0 and HTTPX2 2.10.0.
- CVE-2026-84380Medium
In HTTPX2 prior to version 2.11.0, a vulnerability was found in Request._prepare() in src/httpx2/httpx2/_models.py. It can add a body-derived Content-Length header to a request that already contains a caller-supplied Transfer-Encoding header because its setdefault() processing checks each default header independently rather than treating the two framing headers as mutually exclusive. This can allow request smuggling or connection desynchronization.
- CVE-2026-84379Medium
In HTTPX2 prior to version 2.11.0, a vulnerability was found in FileField.render_headers() in src/httpx2/httpx2/_multipart.py. It directly interpolates attacker-controlled content_type values and custom headers from the files= tuple into multipart/form-data part headers without validating header names or values. CR or LF characters can terminate a part header, inject additional part headers, or end the part header block early, allowing a downstream multipart parser to treat attacker-supplied lines as genuine headers and potentially alter part semantics or bypass header-based checks.
- CVE-2026-84378Medium
In HTTPX2 from version 2.5.0 until 2.10.0, a vulnerability was found in the Server-Sent Events parser in src/httpx2/httpx2/_sse.py. The _SSELineDecoder.decode() method repeatedly copies and rescans buffered text when an attacker-controlled or compromised SSE endpoint splits one unterminated line across many response chunks. The total processing work grows quadratically with the line length, allowing a crafted stream to consume excessive CPU and block a synchronous worker or asynchronous event loop.
Original NVD description (English source)
Response.iter_lines() and Response.aiter_lines() in httpx2 buffered decoded text without any limit on the length of a line. A server can return a small compressed body that decompresses to a large payload with no line separators, making the client hold the whole decompressed payload in memory before yielding a line. A body of about 65 KiB that decompresses to 64 MiB raises peak memory to about 134 MiB, and memory grows linearly with the decompressed size. The per-chunk decompression limit added for CVE-2026-84382 does not bound this buffer. Applications are affected when they stream responses from an untrusted origin with iter_lines() or aiter_lines(), such as NDJSON consumers, log tailers or feed fetchers, using httpx2 before 2.18.0. The issue is fixed in 2.18.0, which limits a buffered line to 1,048,576 characters by default and raises DecodingError beyond it; max_line_length adjusts or disables the limit. Until then, stream untrusted responses with iter_bytes() or aiter_bytes() and enforce a size limit, or request Accept-Encoding: identity.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

