Source: python-httpx2 X-Debbugs-CC: [email protected] Severity: important Tags: security
Hi, The following vulnerabilities were published for python-httpx2. CVE-2026-132651[0]: | httpx2 reassembled fragmented WebSocket messages by appending each | continuation frame to a bytes buffer, copying the whole accumulated | message on every frame. A WebSocket server, or an on-path attacker | on an unencrypted ws:// connection, can split messages into many | tiny continuation frames so that reassembly takes time quadratic in | the number of frames. Reassembly holds the GIL in the synchronous | client and blocks the event loop in the asynchronous client. | Applications are affected when they open a WebSocket session with | client.websocket() or httpx2.websocket() to an untrusted endpoint, | using httpx2 from 2.6.0 up to (but excluding) 2.18.0. From 2.10.0, | the default max_message_size_bytes limit of 64 KiB bounds the work | per message, so sustained load needs many messages; versions 2.6.0 | to 2.9.1 have no such limit. The issue is fixed in 2.18.0, which | collects fragments in a list and joins them once when the final | frame arrives. Until then, keep max_message_size_bytes small and | connect only to trusted wss:// endpoints. https://github.com/pydantic/httpx2/security/advisories/GHSA-3w8q-h8jv-vvhw CVE-2026-142020[1]: | 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. https://github.com/pydantic/httpx2/security/advisories/GHSA-9333-m6rv-gmq9 CVE-2026-140868[2]: | When following a redirect to a different origin, httpx2 removes the | Authorization and Cookie headers but keeps Proxy-Authorization. A | client that sets Proxy-Authorization in its client or request | headers sends that credential to the redirect target, where an | attacker who controls the redirecting response, or an on-path | attacker on plain HTTP, can capture it. Applications are affected | when all of the following hold: follow_redirects=True is set (the | default is False), Proxy-Authorization is passed in headers rather | than through the proxy parameter, and the redirect target is not | reached through the same forward proxy that consumed the header on | the first request. Proxy credentials given in the proxy URL are not | affected. Affected versions are httpx2 before 2.18.0. The issue is | fixed in 2.18.0, which removes Proxy-Authorization whenever a | redirect changes origin. Until then, give proxy credentials in the | proxy URL instead of a header, or leave follow_redirects off. https://github.com/pydantic/httpx2/security/advisories/GHSA-5r6f-m46c-mphm If you fix the vulnerabilities please also make sure to include the CVE (Common Vulnerabilities & Exposures) ids in your changelog entry. For further information see: [0] https://security-tracker.debian.org/tracker/CVE-2026-132651 https://www.cve.org/CVERecord?id=CVE-2026-132651 [1] https://security-tracker.debian.org/tracker/CVE-2026-142020 https://www.cve.org/CVERecord?id=CVE-2026-142020 [2] https://security-tracker.debian.org/tracker/CVE-2026-140868 https://www.cve.org/CVERecord?id=CVE-2026-140868 Please adjust the affected versions in the BTS as needed.

