Advisory

PYSEC-2026-1998

Also known as: CVE-2025-66418, GHSA-gm62-xv2j-4w53

Summary

urllib3 allows an unbounded number of links in the decompression chain

Details

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` and ensure that resp.headers["content-encoding"] contains a safe number of encodings before reading the response content.

Severity

Not rated by the source.

Dates

Published
2026-07-07 16:03 UTC
Modified
2026-07-07 17:47 UTC

Affected packages and fixes

urllib3

PyPI · All systems

Affected

  • introduced 1.24, fixed 2.6.0 (ecosystem)

Fixed versions

2.6.0

Fix

  • Fixed version 2.6.0
    pip install --upgrade urllib3==2.6.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences