CVE-2025-50181: urllib3 redirects are not disabled when retries are disabled on PoolManager instantiation

Published Jun 18, 2025
·
Updated

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:

python 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:

python 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 the PoolManager() level.

Other sources

urllib3 is a user-friendly HTTP client library for Python. Prior to 2.5.0, it is possible to disable redirects for all requests by instantiating a PoolManager and specifying retries in a way that disable redirects. By default, requests and botocore users are not affected. An application attempting to mitigate SSRF or open redirect vulnerabilities by disabling redirects at the PoolManager level will remain vulnerable. This issue has been patched in version 2.5.0.

— NVD

urllib3 redirects are not disabled when retries are disabled on PoolManager instantiation

— Microsoft

Affected Software

25 affected componentsFixes available
pip/urllib3<2.5.0
2.5.0
Python urllib3<2.5.0
IBM Db2 Genius Hub<=1.1, 1.1.1, 1.1.2
IBM Agentics<=1.0
debian/python-urllib3
1.26.5-1~exp1+deb11u21.26.12-1+deb12u22.3.0-3
ubuntu/python-urllib3<1.13.1-2ubuntu0.16.04.4+esm3
1.13.1-2ubuntu0.16.04.4+esm3
ubuntu/python-urllib3<1.22-1ubuntu0.18.04.2+esm3
1.22-1ubuntu0.18.04.2+esm3
ubuntu/python-urllib3<1.25.8-2ubuntu0.4+esm1
1.25.8-2ubuntu0.4+esm1
ubuntu/python-pip<22.0.2+dfsg-1ubuntu0.6
22.0.2+dfsg-1ubuntu0.6
ubuntu/python-urllib3<1.26.5-1~exp1ubuntu0.3
1.26.5-1~exp1ubuntu0.3
ubuntu/python-pip<24.0+dfsg-1ubuntu1.2
24.0+dfsg-1ubuntu1.2
ubuntu/python-urllib3<2.0.7-1ubuntu0.2
2.0.7-1ubuntu0.2
All of the following
azurelinux/python-urllib3<1.26.19-2
1.26.19-2
Microsoft CBL-Mariner=2.0
All of the following
azurelinux/python-pip<24.2-3
24.2-3
Microsoft Azure Linux=3.0
All of the following
azurelinux/python-virtualenv<20.26.6-2
20.26.6-2
Microsoft CBL-Mariner=2.0
All of the following
azurelinux/python-urllib3<2.0.7-2
2.0.7-2
Microsoft Azure Linux=3.0
All of the following
azurelinux/python-pip<0:25.1.1-23.azl4
0:25.1.1-23.azl4
Microsoft Azure Linux=4.0
debian/python-urllib3<1.26.12-1+deb12u2
1.26.12-1+deb12u2
debian/python-urllib3<2.3.0-3
2.3.0-3
debian/python-urllib3<2.3.0-3
2.3.0-3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/urllib3 to a version that resolves this vulnerability.

    Fixed in 2.5.0
  2. Upgrade

    Upgrade debian/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.5-1~exp1+deb11u2Fixed in 1.26.12-1+deb12u2Fixed in 2.3.0-3
  3. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.13.1-2ubuntu0.16.04.4+esm3
  4. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.22-1ubuntu0.18.04.2+esm3
  5. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.25.8-2ubuntu0.4+esm1
  6. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 22.0.2+dfsg-1ubuntu0.6
  7. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.5-1~exp1ubuntu0.3
  8. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 24.0+dfsg-1ubuntu1.2
  9. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.7-1ubuntu0.2
  10. Upgrade

    Upgrade azurelinux/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.19-2
  11. Upgrade

    Upgrade azurelinux/python-pip to a version that resolves this vulnerability.

    Fixed in 24.2-3
  12. Upgrade

    Upgrade azurelinux/python-pip to a version that resolves this vulnerability.

    Fixed in 24.2-5
  13. Upgrade

    Upgrade azurelinux/python-virtualenv to a version that resolves this vulnerability.

    Fixed in 20.26.6-2
  14. Upgrade

    Upgrade azurelinux/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.7-2
  15. Upgrade

    Upgrade azurelinux/python-pip to a version that resolves this vulnerability.

    Fixed in 0:25.1.1-23.azl4
  16. Upgrade

    Upgrade debian/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.12-1+deb12u2
  17. Upgrade

    Upgrade debian/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 2.3.0-3
  18. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 2.5.0Patch 2.5.0
  19. Configuration

    Disable redirects at the request level instead of the PoolManager level. If needed, set PoolManager(retries=0) so that a redirect triggers a MaxRetryError.

    urllib3 PoolManager retries = 0 (PoolManager(retries=0) should raise MaxRetryError on redirect)

Event History

Jun 18, 2025
Advisory Published
via GitHub·05:50 PM
Data Sourced
via GitHub·05:50 PM
DescriptionSeverityWeaknessAffected Software
Jun 19, 2025
CVE Published
via MITRE·01:08 AM
Data Sourced
via MITRE·01:08 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:15 AM
DescriptionSeverityWeakness
Jul 18, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
Affected Software
Sep 18, 2025
Data Sourced
via NVD·01:51 PM
RemedyAffected Software
Updated
via NVD·01:51 PM
Severity
Event
via NVD·01:51 PM
Oct 28, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Dec 22, 2025
Updated
via IBM·12:00 AM
Affected Software
Mar 25, 2026
Updated
via IBM·12:00 AM
Affected Software
Apr 6, 2026
Updated
via IBM·12:00 AM
Affected Software
May 14, 2026
Updated
via IBM·12:00 AM
Affected Software
Jun 17, 2026
Updated
via NVD·09:34 AM
Severity
Jun 19, 2026
Updated
via IBM·12:00 AM
Affected Software
Jun 24, 2026
Updated
via IBM·12:00 AM
Affected Software
Jul 13, 2026
Updated
via IBM·12:00 AM
Affected Software
Nov 24, 2026
Data Sourced
via OSV·02:55 PM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-50181?

The severity of CVE-2025-50181 is classified based on its potential impact on security and affected environments.

2

How do I fix CVE-2025-50181?

To fix CVE-2025-50181, update urllib3 to version 2.5.0 or higher.

3

What applications are affected by CVE-2025-50181?

CVE-2025-50181 affects applications using urllib3 versions prior to 2.5.0.

4

What does CVE-2025-50181 affect in the urllib3 library?

CVE-2025-50181 affects the handling of redirects and retries in the urllib3 library.

5

Is disabling redirects a potential mitigation for CVE-2025-50181?

Yes, disabling redirects at the request level can be a temporary mitigation for CVE-2025-50181.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203