CVE-2025-66471
ADVISORY - githubSummary
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.
When streaming a compressed response, urllib3 can perform decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). The library must read compressed data from the network and decompress it until the requested chunk size is met. Any resulting decompressed data that exceeds the requested amount is held in an internal buffer for the next read operation.
The decompression logic could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This can result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data; CWE-409) on the client side, even if the application only requested a small chunk of data.
Affected usages
Applications and libraries using urllib3 version 2.5.0 and earlier to stream large compressed responses or content from untrusted sources.
stream(), read(amt=256), read1(amt=256), read_chunked(amt=256), readinto(b) are examples of urllib3.HTTPResponse method calls using the affected logic unless decoding is disabled explicitly.
Remediation
Upgrade to at least urllib3 v2.6.0 in which the library avoids decompressing data that exceeds the requested amount.
If your environment contains a package facilitating the Brotli encoding, upgrade to at least Brotli 1.2.0 or brotlicffi 1.2.0.0 too. These versions are enforced by the urllib3[brotli] extra in the patched versions of urllib3.
Credits
The issue was reported by @Cycloctane. Supplemental information was provided by @stamparm during a security audit performed by 7ASecurity and facilitated by OSTIF.
Common Weakness Enumeration (CWE)
Improper Handling of Highly Compressed Data (Data Amplification)
Improper Handling of Highly Compressed Data (Data Amplification)
GitHub
-
CVSS SCORE
8.9high| Package | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
|---|---|---|---|---|---|
| urllib3 | pypi | - | - | >=1.0,<2.6.0 | 2.6.0 |
CVSS:4 Severity and metrics
The CVSS metrics represent different qualitative aspects of a vulnerability that impact the overall score, as defined by the CVSS Specification.
The vulnerable component is bound to the network stack, but the attack is limited at the protocol level to a logically adjacent topology. This can mean an attack must be launched from the same shared physical (e.g., Bluetooth or IEEE 802.11) or logical (e.g., local IP subnet) network, or from within a secure or otherwise limited administrative domain (e.g., MPLS, secure VPN to an administrative network zone). One example of an Adjacent attack would be an ARP (IPv4) or neighbor discovery (IPv6) flood leading to a denial of service on the local LAN segment (e.g., CVE-2013-6014).
Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.
The successful attack depends on the presence of specific deployment and execution conditions of the vulnerable system that enable the attack. These include: A race condition must be won to successfully exploit the vulnerability. The successfulness of the attack is conditioned on execution conditions that are not under full control of the attacker. The attack may need to be launched multiple times against a single target before being successful. Network injection. The attacker must inject themselves into the logical network path between the target and the resource requested by the victim (e.g. vulnerabilities requiring an on-path attacker).
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
The vulnerable system can be exploited without interaction from any human user, other than the attacker. Examples include: a remote attacker is able to send packets to a target system a locally authenticated attacker executes code to elevate privileges.
There is no loss of confidentiality within the Vulnerable System.
There is no loss of confidentiality within the Subsequent System or all confidentiality impact is constrained to the Vulnerable System.
There is no loss of integrity within the Vulnerable System.
There is no loss of integrity within the Subsequent System or all integrity impact is constrained to the Vulnerable System.
There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the Vulnerable System; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the Vulnerable System (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).
There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the Subsequent System; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the Subsequent System (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).
NIST
3.9
CVSS SCORE
8.9highDebian
-
Ubuntu
3.9
CVSS SCORE
7.5mediumAmazon
-
CVSS SCORE
N/AmediumChainguard
CGA-2239-48qp-fjhw
-
Chainguard
CGA-22xf-m2vj-qvrm
-
Chainguard
CGA-3vv3-3897-wc6m
-
Chainguard
CGA-3xph-4x32-2294
-
Chainguard
CGA-4jv7-7488-chv3
-
Chainguard
CGA-4w57-9fgh-57jw
-
Chainguard
CGA-56rq-hq83-9c69
-
Chainguard
CGA-58vh-h7h5-3h9r
-
Chainguard
CGA-7fmw-jp33-q547
-
Chainguard
CGA-7xhv-j2ch-9fvr
-
Chainguard
CGA-9qm6-p8vc-v2qh
-
Chainguard
CGA-f4p4-74h6-whhc
-
Chainguard
CGA-fwhw-778c-9633
-
Chainguard
CGA-g675-r3q9-6wc7
-
Chainguard
CGA-mvh3-23cf-rpgx
-
Chainguard
CGA-p2ph-447q-w2g8
-
Chainguard
CGA-qx84-fvm4-3ch9
-
Chainguard
CGA-rwj5-v378-3ffp
-
Chainguard
CGA-rx6j-j643-4x6c
-
Chainguard
CGA-vgrv-948f-39x5
-
Chainguard
CGA-vjfw-755g-xqwm
-
Chainguard
CGA-wc6f-wpgj-rcjj
-
Chainguard
CGA-x93x-3xvv-7mw6
-
Chainguard
CGA-xqx6-2rgm-hgch
-
minimos
MINI-2xv4-2mfg-wrr2
-
minimos
MINI-32jp-fmxp-x89h
-
minimos
MINI-38w9-v5vg-h9p3
-
minimos
MINI-cpr6-qwph-69pf
-
minimos
MINI-gjgm-ch9r-mgm7
-
minimos
MINI-jp2h-32gh-w4cx
-
minimos
MINI-r38x-pgr5-94j5
-
minimos
MINI-x2xm-r5xf-pvr2
-