CVE-2025-66418: Urllib3 Urllib3 Allows An Unbounded Number Vulnerability

HIGH
Advisory Identifier: GHSA-gm62-xv2j-4w53
CWE-770
Published
Advisory Summary

CVE-2025-66418 is a HIGH urllib3 allows an unbounded number vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Urllib3 libraries in the PyPI ecosystem. The issue involves urllib3 allows an unbounded number of links in the decompression chain. Remediation is available by upgrading affected packages to version 2.6.0.

CVE-2025-66418 at a Glance

CVE Identifier CVE-2025-66418
GHSA Identifier GHSA-gm62-xv2j-4w53
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Urllib3
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-66418

To remediate this vulnerability, upgrade all affected Urllib3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

urllib3 fixed: 2.6.0
pip install urllib3>=2.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show urllib3

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-66418, inspect your installed packages using pip:

pip show urllib3

Analyze the terminal output to locate any version of Urllib3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.0), your application is affected.

Note: The pip show urllib3 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Urllib3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Impact urllib3 supports chained HTTP encoding algorithms for response content according to RFC 9110 (e.g., `Content-Encoding: gzip, zstd`). However, the number of links in the decompression chain was unbounded allowing a malicious server to insert a virtually unlimited number of compression steps leading to high CPU usage and massive memory allocation for the decompressed data. ## Affected usages Applications and libraries using urllib3 version 2.5.0 and earlier for HTTP requests to untrusted sources unless they disable content decoding explicitly. ## Remediation Upgrade to at least urllib3 v2.6.0 in which the library limits the number of links to 5. If upgrading is not immediately possible, use [`preload_content=False`](https://urllib3.readthedocs.io/en/2.5.0/advanced-usage.html#streaming-and-i-o) and ensure that `resp.headers["content-encoding"]` contains a safe number of encodings before reading the response content.

CVE-2025-66418 Affected Urllib3 Versions

1 component(s)
Fixed Versions:
2.6.0
Product / Package Ecosystem Affected Versions Fixed Version
urllib3
PyPI
≥ 1.24
< 2.6.0
2.6.0

References

Frequently Asked Questions

What is CVE-2025-66418?
CVE-2025-66418 is a security vulnerability in Urllib3 involving urllib3 allows an unbounded number of links in the decompression chain under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Urllib3 versions are affected?
Affected versions include releases prior to 2.6.0 across affected packages: urllib3.
What version fixes CVE-2025-66418?
Upgrading to 2.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is urllib3 affected?
Yes, urllib3 is affected in releases prior to 2.6.0. Upgrade your dependency to 2.6.0 or later.
What CWE is associated with CVE-2025-66418?
CVE-2025-66418 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check PyPI dependencies for CVE-2025-66418?
Run the dependency tree command: 'pip show urllib3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gm62-xv2j-4w53",
  "modified" : "2025-12-05T18:32:59Z",
  "published" : "2025-12-05T18:15:19Z",
  "aliases" : [ "CVE-2025-66418" ],
  "summary" : "urllib3 allows an unbounded number of links in the decompression chain",
  "details" : "## Impact\n\nurllib3 supports chained HTTP encoding algorithms for response content according to RFC 9110 (e.g., `Content-Encoding: gzip, zstd`).\n\nHowever, the number of links in the decompression chain was unbounded allowing a malicious server to insert a virtually unlimited number of compression steps leading to high CPU usage and massive memory allocation for the decompressed data.\n\n\n## Affected usages\n\nApplications and libraries using urllib3 version 2.5.0 and earlier for HTTP requests to untrusted sources unless they disable content decoding explicitly.\n\n\n## Remediation\n\nUpgrade to at least urllib3 v2.6.0 in which the library limits the number of links to 5.\n\nIf upgrading is not immediately possible, use [`preload_content=False`](https://urllib3.readthedocs.io/en/2.5.0/advanced-usage.html#streaming-and-i-o) and ensure that `resp.headers[\"content-encoding\"]` contains a safe number of encodings before reading the response content.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "urllib3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.24"
      }, {
        "fixed" : "2.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/urllib3/urllib3/security/advisories/GHSA-gm62-xv2j-4w53"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66418"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/urllib3/urllib3/commit/24d7b67eac89f94e11003424bcf0d8f7b72222a8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/urllib3/urllib3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-05T18:15:19Z",
    "nvd_published_at" : "2025-12-05T16:15:51Z"
  }
}