Skip to content

GHSA-38jv-5279-wg99 CVE-2026-21441 PYSEC-2026-1996

Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API)

High PyPI
Severity
8.9 / 10
High · CVSS 4.0
Exploit chance (EPSS)
2.92%
Chance of exploitation in the next 30 days. Higher than 87.04% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-409 Improper Handling of Highly Compressed Data (Data Amplification)
Fix
2.6.3
Upgrade urllib3 to this version or later

Description

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 decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). When using the streaming API, the library decompresses only the necessary bytes, enabling partial content consumption.

However, for HTTP redirect responses, the library would read the entire response body to drain the connection and decompress the content unnecessarily. This decompression occurred even before any read methods were called, and configured read limits did not restrict the amount of decompressed data. As a result, there was no safeguard against decompression bombs. A malicious server could exploit this to trigger excessive resource consumption on the client (high CPU usage and large memory allocations for decompressed data; CWE-409).

Affected usages

Applications and libraries using urllib3 version 2.6.2 and earlier to stream content from untrusted sources by setting preload_content=False when they do not disable redirects.

Remediation

Upgrade to at least urllib3 v2.6.3 in which the library does not decode content of redirect responses when preload_content=False.

If upgrading is not immediately possible, disable redirects by setting redirect=False for requests to untrusted source.

Affected versions

PyPI

PackageVulnerableFixed in
urllib3
>= 1.22, < 2.6.3
2.6.3
urllib3
>= 1.22, < 2.6.3
2.6.3

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

urllib3 PyPI → 2.6.3

pip
pip install --upgrade "urllib3>=2.6.3"
poetry
poetry add "urllib3>=2.6.3"
uv
uv add "urllib3>=2.6.3"

Severity breakdown

CVSS 4.0 8.9

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
High

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)

The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.

References

Advisories

Fixes and patches

Packages

Other links

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-vxq7-64xx-v4gw
urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory
High Also affects urllib3
GHSA-gh4c-6fx4-qh6g
urllib3: Chunked Deflate streaming can enter an infinite loop
Medium Also affects urllib3
GHSA-8988-9cw3-xx77
urllib3: HTTPS proxy TLS configuration may be ignored or overridden
High Also affects urllib3
GHSA-mf9v-mfxr-j63j
urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API
High Also affects urllib3
GHSA-qccp-gfcp-xxvc
urllib3: Sensitive headers forwarded across origins in proxied low-level redirects
High Also affects urllib3
GHSA-2xpw-w6gg-jr37
urllib3 streaming API improperly handles highly compressed data
High Also affects urllib3
GHSA-gm62-xv2j-4w53
urllib3 allows an unbounded number of links in the decompression chain
High Also affects urllib3
GHSA-48p4-8xcf-vxj5
urllib3 does not control redirects in browsers and Node.js
Medium Also affects urllib3

Credits: D47A, illia-v, pquentin, sethmlarson

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor