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')
NIST
1.6
CVSS SCORE
5.3mediumGitHub
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
-