CVE-2026-44432: urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
Impact
urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once.
urllib3 can perform decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). When using the streaming API since version 2.6.0, the library decompresses only the necessary bytes, enabling partial content consumption.
However, urllib3 before version 2.7.0 could still decompress the whole response instead of the requested portion in two cases: 1. During the second HTTPResponse.read(amt=N) call when the response was decompressed using the official Brotli library. 2. When HTTPResponse.drainconn() was called after the response had been read and decompressed partially (compression algorithm did not matter here).
These issues could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This could result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data; CWE-409) on the client side.
Affected usages
Applications and libraries using urllib3 versions earlier than 2.7.0 may be affected when streaming compressed responses from untrusted sources in either of these cases, unless decompression is explicitly disabled:
1. A response encoded with br is read incrementally with at least two HTTPResponse.read(amt=N) or HTTPResponse.stream(amt=N) calls while using the official Brotli library. 2. HTTPResponse.drainconn() is called after response decompression has already started.
Remediation
Upgrade to at least urllib3 version 2.7.0 in which the library: 1. Is more efficient for reads with Brotli. 2. Always skips decompression for HTTPResponse.drainconn().
If upgrading is not immediately possible, the following workarounds may reduce exposure in specific cases: 1. For the Brotli-specific issue only, switch from brotli to brotlicffi until you can upgrade urllib3; the official Brotli package is affected because of https://github.com/google/brotli/issues/1396. 2. If your code explicitly calls HTTPResponse.drainconn(), call HTTPResponse.close() instead when connection reuse is not important.
Credits
The Brotli-specific issue was reported by @kimkou2024. HTTPResponse.drainconn() inefficiency was reported by @Cycloctane.
Other sources
urllib3 is an HTTP client library for Python. From 2.6.0 to before 2.7.0, urllib3 could decompress the whole response instead of the requested portion (1) during the second HTTPResponse.read(amt=N) call when the response was decompressed using the official Brotli library or (2) when HTTPResponse.drainconn() was called after the response had been read and decompressed partially (compression algorithm did not matter here). These issues could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This could result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data) on the client side. This vulnerability is fixed in 2.7.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/urllib3to a version that resolves this vulnerability.Fixed in 2.7.0 - Upgrade
Upgrade
urllib3to a version that resolves this vulnerability.Fixed in 2.7.0 - Configuration
If you are affected by the Brotli-specific issue and cannot upgrade urllib3 immediately, switch from the official Brotli library (brotli) to brotlicffi for decompression until you can upgrade urllib3 (the official brotli package is affected because of the referenced brotli issue).
urllib3 (Brotli decoding) Brotli decompressor library = brotlicffi - Configuration
If your code explicitly calls HTTPResponse.drain_conn() and connection reuse is not important, call HTTPResponse.close() instead to reduce exposure in the drain_conn-related cases.
urllib3 HTTPResponse (connection handling) drain_conn vs close = call HTTPResponse.close() instead of HTTPResponse.drain_conn()
Event History
Frequently Asked Questions
What is the severity of CVE-2026-44432?
CVE-2026-44432 has a high severity as it allows attackers to bypass decompression-bomb safeguards in urllib3's streaming API.
How do I fix CVE-2026-44432?
To mitigate CVE-2026-44432, upgrade urllib3 to version 2.7.1 or later immediately.
What is the impact of CVE-2026-44432?
The impact of CVE-2026-44432 includes potential denial of service through resource exhaustion when processing large HTTP response bodies.
Which versions of urllib3 are affected by CVE-2026-44432?
CVE-2026-44432 affects urllib3 versions between 2.6.0 and 2.7.0, inclusive.
What is the cause of CVE-2026-44432?
CVE-2026-44432 is caused by the improper handling of decompression-bomb threats in the streaming API of urllib3.