CVE-2025-50181
ADVISORY - githubSummary
urllib3 handles redirects and retries using the same mechanism, which is controlled by the Retry
object. The most common way to disable redirects is at the request level, as follows:
resp = urllib3.request("GET", "https://httpbin.org/redirect/1", redirect=False)
print(resp.status)
# 302
However, it is also possible to disable redirects, for all requests, by instantiating a PoolManager
and specifying retries
in a way that disable redirects:
import urllib3
http = urllib3.PoolManager(retries=0) # should raise MaxRetryError on redirect
http = urllib3.PoolManager(retries=urllib3.Retry(redirect=0)) # equivalent to the above
http = urllib3.PoolManager(retries=False) # should return the first response
resp = http.request("GET", "https://httpbin.org/redirect/1")
However, the retries
parameter is currently ignored, which means all the above examples don't disable redirects.
Affected usages
Passing retries
on PoolManager
instantiation to disable redirects or restrict their number.
By default, requests and botocore users are not affected.
Impact
Redirects are often used to exploit SSRF vulnerabilities. An application attempting to mitigate SSRF or open redirect vulnerabilities by disabling redirects at the PoolManager level will remain vulnerable.
Remediation
You can remediate this vulnerability with the following steps:
- Upgrade to a patched version of urllib3. If your organization would benefit from the continued support of urllib3 1.x, please contact sethmichaellarson@gmail.com to discuss sponsorship or contribution opportunities.
- Disable redirects at the
request()
level instead of thePoolManager()
level.
Common Weakness Enumeration (CWE)
URL Redirection to Untrusted Site ('Open Redirect')
URL Redirection to Untrusted Site ('Open Redirect')
GitHub
1.6
CVSS SCORE
5.3mediumPackage | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
---|---|---|---|---|---|
urllib3 | pypi | - | - | <2.5.0 | 2.5.0 |
CVSS:3 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).
A successful attack depends on conditions beyond the attacker's control, requiring investing a measurable amount of effort in research, preparation, or execution against the vulnerable component before a successful attack.
The attacker requires privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.
The vulnerable system can be exploited without interaction from any user.
An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.
There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.
There is no loss of trust or accuracy within the impacted component.
There is no impact to availability within the impacted component.
NIST
1.6
CVSS SCORE
5.3mediumDebian
-
Ubuntu
2.8
CVSS SCORE
6.1mediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumChainguard
CGA-2hvc-g7jr-8j6v
-
Chainguard
CGA-3fcq-qvf6-cwrf
-
Chainguard
CGA-3hxw-cr3x-p4c5
-
Chainguard
CGA-4p7h-xgpg-2mxx
-
Chainguard
CGA-4qgw-vjh8-cq98
-
Chainguard
CGA-54xh-6ccp-w8r6
-
Chainguard
CGA-5jr3-5338-g69j
-
Chainguard
CGA-5phw-374r-3675
-
Chainguard
CGA-7m4w-697m-9ph3
-
Chainguard
CGA-fh4x-jv4q-7558
-
Chainguard
CGA-g5vp-w736-w3rf
-
Chainguard
CGA-hp9q-7vm7-gg5m
-
Chainguard
CGA-j2ph-8qfq-2q24
-
Chainguard
CGA-pfx8-jp22-3rcr
-
Chainguard
CGA-qcmw-2jr2-h5r5
-
Chainguard
CGA-whj8-xw5x-75rj
-
Chainguard
CGA-xg36-3jm9-q638
-
Chainguard
CGA-xjwc-3hcr-x828
-
minimos
MINI-3pxj-fv3g-fcmw
-
minimos
MINI-4wqw-jxcf-vhwx
-
minimos
MINI-5jg9-rf79-w63f
-
minimos
MINI-g8cr-599c-g56j
-
minimos
MINI-phw3-8mw6-vxx4
-
minimos
MINI-r6wh-mfm7-qp25
-