CVE-2026-142230: httpx2 through 2.17.0 Memory Exhaustion via iter_lines and aiter_lines
Pydantic httpx2 through 2.17.0 contains an unbounded memory allocation vulnerability in LineDecoder that allows malicious servers to exhaust client memory by sending decompressed bodies without newlines. Attackers can return highly compressed gzip, deflate, brotli or zstd responses that inflate roughly 1000 to 1, terminating clients reading via iterlines() or aiterlines().
Affected Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using pypi/httpx2 through version 2.17.0 are exposed when they consume a response with iter_lines() or aiter_lines(). Exposure depends on receiving a crafted response from a malicious server.
What does an attacker need to do to trigger the condition?
An attacker needs to make the client read a compressed response body that contains no newline characters through iter_lines() or aiter_lines(). The response can use gzip, deflate, brotli, or zstd compression and expand by roughly 1000 times when decompressed.
How can I determine whether my application may be affected?
Check whether your dependency version is 2.17.0 or earlier, and review code paths that call iter_lines() or aiter_lines() on HTTP responses. Those paths are relevant if they can connect to a malicious or attacker-controlled server.