Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-142020— Unbounded iter_lines() and aiter_lines() buffering enables memory exhaustion via decompression amplification

Quick assessment

Affected
pydantic httpx2
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

httpx2 中的 Response.iter_lines() 和 Response.aiter_lines() 在缓冲解码文本时,对行长度没有施加任何限制。服务器可返回一个较小的压缩响应体,解压后成为不含行分隔符的大量数据,导致客户端在产出一行之前将整个解压后的负载保留在内存中。约 65 KiB 的响应体解压为 64 MiB 时,峰值内存升至约 134 MiB,且内存随解压后大小线性增长。为 CVE-2026-84382 添加的逐块解压限制并不对此缓冲区施加约束。 使用 httpx2 2.18.0 之前版本的应用

CVSS 5.9 · Medium
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-142020

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Unbounded iter_lines() and aiter_lines() buffering enables memory exhaustion via decompression amplification
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
对高度压缩数据的处理不恰当(数据放大攻击)
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
pydantic httpx2 0 ~ 2.18.0 -

II. Public POCs for CVE-2026-142020

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-142020

请登录查看更多情报信息。

Vendor Advisories for CVE-2026-142020 (1)

Other References for CVE-2026-142020 (1)

Same Patch Batch · pydantic · 2026-12-04 · 3 CVEs total

CVE-2026-132651 5.3 MEDIUM Quadratic WebSocket fragment reassembly causes CPU denial of service
CVE-2026-140868 3.7 LOW Proxy-Authorization header not stripped on cross-origin redirects leaks proxy credentials

IV. Related Vulnerabilities