CVE-2026-142020
Unbounded iter_lines() and aiter_lines() buffering enables memory exhaustion via decompression amplification
Description
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.
INFO
Published Date :
Dec. 4, 2026, 11:28 a.m.
Last Modified :
Dec. 4, 2026, 11:28 a.m.
Remotely Exploit :
Yes !
Source :
Pydantic
Affected Products
The following products are affected by CVE-2026-142020
vulnerability.
Even if cvefeed.io is aware of the exact versions of the
products
that
are
affected, the information is not represented in the table below.
No affected product recoded yet
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | MITRE-CVE |
Solution
- Update httpx2 to version 2.18.0 or later.
- Stream untrusted responses using iter_bytes() or aiter_bytes().
- Enforce a size limit when streaming untrusted responses.
- Request Accept-Encoding: identity for untrusted responses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-142020 vulnerability anywhere in the article.