{"id":"CVE-2025-66471","aliases":["CVE-2025-66471","GHSA-2xpw-w6gg-jr37","PYSEC-2026-1994"],"related":[],"kind":"vulnerability","state":"published","title":"urllib3 Streaming API improperly handles highly compressed data","summary":"urllib3 is a user-friendly HTTP client library for Python. Starting in version 1.0 and prior to 2.6.0, the Streaming API improperly handles highly compressed data. urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When streaming a compressed response, urllib3 can perform decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). The library must read compressed data from the network and decompress it until the requested chunk size is met. Any resulting decompressed data that exceeds the requested amount is held in an internal buffer for the next read operation. The decompression logic could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This can result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"urllib3 is a user-friendly HTTP client library for Python. Starting in version 1.0 and prior to 2.6.0, the Streaming API improperly handles highly compressed data. urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When streaming a compressed response, urllib3 can perform decoding or decompression based on the HTTP Content-Encoding header (e.g., gzip, deflate, br, or zstd). The library must read compressed data from the network and decompress it until the requested chunk size is met. Any resulting decompressed data that exceeds the requested amount is held in an internal buffer for the next read operation. The decompression logic could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This can result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nurllib3's [streaming API](https://urllib3.readthedocs.io/en/2.5.0/advanced-usage.html#streaming-and-i-o) is designed for the efficient handling of large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once.\n\nWhen streaming a compressed response, urllib3 can perform decoding or decompression based on the HTTP `Content-Encoding` header (e.g., `gzip`, `deflate`, `br`, or `zstd`). The library must read compressed data from the network and decompress it until the requested chunk size is met. Any resulting decompressed data that exceeds the requested amount is held in an internal buffer for the next read operation.\n\nThe decompression logic could cause urllib3 to fully decode a small amount of highly compressed data in a single operation. This can result in excessive resource consumption (high CPU usage and massive memory allocation for the decompressed data; CWE-409) on the client side, even if the application only requested a small chunk of data.\n\n\n### Affected usages\n\nApplications and libraries using urllib3 version 2.5.0 and earlier to stream large compressed responses or content from untrusted sources.\n\n`stream()`, `read(amt=256)`, `read1(amt=256)`, `read_chunked(amt=256)`, `readinto(b)` are examples of `urllib3.HTTPResponse` method calls using the affected logic unless decoding is disabled explicitly.\n\n\n### Remediation\n\nUpgrade to at least urllib3 v2.6.0 in which the library avoids decompressing data that exceeds the requested amount.\n\nIf your environment contains a package facilitating the Brotli encoding, upgrade to at least Brotli 1.2.0 or brotlicffi 1.2.0.0 too. These versions are enforced by the `urllib3[brotli]` extra in the patched versions of urllib3.\n\n\n### Credits\n\nThe issue was reported by @Cycloctane.\nSupplemental information was provided by @stamparm during a security audit performed by [7ASecurity](https://7asecurity.com/) and facilitated by [OSTIF](https://ostif.org/).","format":"markdown","source":"ghsa"},{"lang":"es","text":"urllib3 es una biblioteca cliente HTTP fácil de usar para Python. A partir de la versión 1.0 y versiones anteriores a la 2.6.0, la API de Streaming maneja incorrectamente los datos altamente comprimidos. La API de streaming de urllib3 está diseñada para el manejo eficiente de grandes respuestas HTTP leyendo el contenido en fragmentos, en lugar de cargar todo el cuerpo de la respuesta en la memoria de una sola vez. Al transmitir una respuesta comprimida, urllib3 puede realizar la decodificación o descompresión basándose en el encabezado HTTP Content-Encoding (por ejemplo, gzip, deflate, br o zstd). La biblioteca debe leer datos comprimidos de la red y descomprimirlos hasta que se alcance el tamaño de fragmento solicitado. Cualquier dato descomprimido resultante que exceda la cantidad solicitada se mantiene en un búfer interno para la siguiente operación de lectura. La lógica de descompresión podría hacer que urllib3 decodifique completamente una pequeña cantidad de datos altamente comprimidos en una sola operación. Esto puede resultar en un consumo excesivo de recursos (alto uso de CPU y asignación masiva de memoria para los datos descomprimidos).","source":"nvd"}],"published":"2025-12-05T16:06:08.531Z","modified":"2026-09-25T23:10:00.463Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.9,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-409"],"affected":[{"ranges":[{"version":">= 1.0, < 2.6.0","status":"affected"}],"vendor":"urllib3","product":"urllib3","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.0","status":"affected","fixed":"2.6.0"}],"ecosystem":"PyPI","package":"urllib3","purl":"pkg:pypi/urllib3","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0","fixed":"2.6.0"}],"vendor":"python","product":"urllib3","cpe":"cpe:2.3:a:python:urllib3:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"1.0","status":"affected","fixed":"2.6.0"}],"ecosystem":"PyPI","package":"urllib3","purl":"pkg:pypi/urllib3","source":"pysec"}],"references":[{"url":"https://github.com/urllib3/urllib3/security/advisories/GHSA-2xpw-w6gg-jr37","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/urllib3/urllib3/commit/c19571de34c47de3a766541b041637ba5f716ed7","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66471","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/urllib3/urllib3/commit/d0fde3672e4a4093f7587858dccfc298eb66e46c","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-2xpw-w6gg-jr37","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2026-1994.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/urllib3/urllib3","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/urllib3","tags":["package","web"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-12-05T19:32:57.089Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66471","url":"https://www.cve.org/CVERecord?id=CVE-2025-66471","licence":"CVE Terms of Use","modified":"2025-12-05T19:33:14.832Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2xpw-w6gg-jr37","url":"https://github.com/advisories/GHSA-2xpw-w6gg-jr37","licence":"CC-BY-4.0","modified":"2026-09-25T17:15:05.968Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66471","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66471","licence":"Public domain","modified":"2026-09-25T23:10:00.463Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1994","url":"https://osv.dev/vulnerability/PYSEC-2026-1994","licence":"CC-BY-4.0","modified":"2026-07-07T17:48:15.379Z"}],"updatedAt":"2026-11-25T22:59:08.339Z","epss":{"score":0.00731,"percentile":0.55514,"date":"2026-12-01T12:00:22.000Z"}}