Skip to main content

CVE-2025-50181 — Vulnerability in urllib3 — CVE Details

MEDIUM

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

Published June 18, 2025Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.58%). Schedule for your next planned update.

Does your project use an affected urllib3 version?

Paste your requirements.txt to check it for CVE-2025-50181 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my requirements.txt

Summary

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

Advisory Timeline

  • First published June 18, 2025 (526 days ago).
  • Last revised September 10, 2026 — 448 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update urllib3 to 2.5.0 or later
pip install "urllib3>=2.5.0"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: PyPI (1).

PackageFixed In
urllib3 PyPI · Affected: 0.2, 0.3, 0.3.1, 0.4.0 (+98 more)2.5.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

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

Frequently Asked Questions

What is CVE-2025-50181?
urllib3 redirects are not disabled when retries are disabled on PoolManager instantiation. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
How do I check if my project is affected by CVE-2025-50181?
CVE-2025-50181 affects urllib3. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-50181 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.3

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.58%
EPSS percentile: 41.8

This is a below-median EPSS score — only 41.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-pq67-6m6q-mj2v
PYSEC-2026-1999

Related CVEs

  • CVE-2026-97687
    HIGH

    urllib3: HTTPS proxy TLS configuration may be ignored or overridden

  • CVE-2026-97689
    HIGH

    urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory

  • CVE-2025-66471
    HIGH

    urllib3 streaming API improperly handles highly compressed data

  • CVE-2026-21441
    HIGH

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

  • CVE-2026-97687
    HIGH

    urllib3: HTTPS proxy TLS configuration may be ignored or overridden

  • CVE-2026-97688
    MEDIUM

    urllib3: Chunked Deflate streaming can enter an infinite loop

  • CVE-2024-37891
    MEDIUM

    urllib3's Proxy-Authorization request header isn't stripped during cross-origin redirects

  • CVE-2023-45803
    MEDIUM

    urllib3's request body not stripped after redirect from 303 status changes request method to GET

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt