Home › CVE › Vulnerabilities
CVE-2026-142020 — pydantic httpx2
One of 3 pydantic httpx2 vulnerabilities published together by NVD: our article covers all of them.
VulnerabilitiesSummary
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.
Severity breakdown
Medium · 5.9
An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
- Attack from
- the network (remotely)
- Attack complexity
- high (only works under specific conditions)
- Login needed
- no
- User action needed
- no
- Scope
- stays within the vulnerable component
- Impact
- high on availability, none on confidentiality and integrity
Weakness
- CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| pydantic httpx2 | < 2.18.0 | 2.18.0 |
References by type
Vendor advisories
Affected
- pydantic httpx2
What to do
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-142020?
Response.iterlines() and Response.aiterlines() 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. Weakness type: Improper Handling of Highly Compressed Data (Data Amplification) (CWE-409).
How severe is CVE-2026-142020?
CVE-2026-142020 has a CVSS 3.1 base score of 5.9 (medium), from the CNA. An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
Is CVE-2026-142020 being exploited?
Not as far as is known: CVE-2026-142020 is not in CISA's Known Exploited Vulnerabilities catalog as of December 4, 2026.
Which versions are affected by CVE-2026-142020?
pydantic httpx2 < 2.18.0 (fixed in 2.18.0).
How do I fix CVE-2026-142020?
Update to a fixed release: pydantic httpx2 2.18.0.