---
schema_version: '1.0'
id: security-20261001-a4115a
title: 'CVE-2026-97688: urllib3: Chunked Deflate streaming can enter an infinite loop'
url: https://osv.dev/vulnerability/GHSA-gh4c-6fx4-qh6g
url_hash: a4115aac9ad5c44f8a6727ec5c8da2d16658007c1fed30c1ba1f4f37c000696a
canonical_url: https://osv.dev/vulnerability/GHSA-gh4c-6fx4-qh6g
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-97688
- GHSA-gh4c-6fx4-qh6g
- severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- urllib3
- PyPI
lang: en
published_at: '2026-09-30T15:00:38Z'
fetched_at: '2026-10-01T03:59:10.027650Z'
updated_at: '2026-10-01T05:38:51Z'
status: published
content_hash: 6dfa6aae311a5509903c8c68f1b0604d07c20b2bf82afcfc536fc50917626220
content_changed_at: null
license_note: full
summary: 'urllib3: Chunked Deflate streaming can enter an infinite loop'
summary_source: rss
summary_en: 'urllib3: Chunked Deflate streaming can enter an infinite loop'
summary_omitted_reason: null
redistribution: true
keywords_en:
- can
- CanThoPort
- Chunked
- CVE
- CVE-2026-97688
- Deflate
- enter
- GHSA-gh4c-6fx4-qh6g
- infinite
- library vulnerability
- loop
- PyPI
- severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- software security
- streaming
- urllib3
entities_en:
- name: CanThoPort
  type: location
- name: CVE
  type: data
- name: urllib3
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: urllib3
  type: artifact
- name: CanThoPort
  type: location
key_facts: []
related: []
related_auto:
- name: NanningPort
  type: location
  weight: 2.0
- name: BeibuGulfPortGroup
  type: organization
  weight: 1.0
- name: PingluCanal
  type: location
  weight: 1.0
computed_at: '2026-10-01T05:38:46Z'
---

# CVE-2026-97688: urllib3: Chunked Deflate streaming can enter an infinite loop

## TL;DR
urllib3: Chunked Deflate streaming can enter an infinite loop

## Key Points
- cve / CVE-2026-97688 / GHSA-gh4c-6fx4-qh6g / severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N / urllib3 / PyPI

## Details
**Severity:** CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
**Advisory:** GHSA-gh4c-6fx4-qh6g (CVE-2026-97688)

**Details:**
### Impact

urllib3's streaming API is designed for the efficient handling of large HTTP responses by reading content in chunks instead of loading the entire response body into memory at once.

urllib3 can decompress response bodies according to the HTTP `Content-Encoding` header. When streaming a compressed, chunked response, urllib3 first consumes data already buffered by the decoder before reading the next HTTP chunk.

However, urllib3 versions from 2.6.2 through 2.7.0 could enter an infinite loop when a chunked response contained bytes after the end of the Deflate stream. If the decompressed body exceeded the requested streaming chunk size, Python's zlib implementation could retain the trailing bytes as unconsumed input after reaching the end of the compressed stream. urllib3 would repeatedly attempt to decode those same bytes without making progress or reading more data from the network.

A malicious server could exploit this behavior to cause excessive CPU usage and prevent the affected request from completing on the client. Network read timeouts would not interrupt the loop because no further socket operation was required.

### Affected usages

Applications and libraries using urllib3 versions 2.6.2 through 2.7.0 may be affected when all of the following conditions are met:

1. Compressed responses from an untrusted source are streamed using `HTTPResponse.stream(amt=N)` or `HTTPResponse.read_chunked(amt=N)` with a positive, finite chunk size.
2. Content decoding is enabled.
3. The response uses both `Transfer-Encoding: chunked` and `Content-Encoding: deflate`.
4. The decoded body exceeds the requested chunk size and the encoded body contains bytes after the end of the Deflate stream.

`HTTPResponse.stream()` uses a finite chunk size by default and is therefore affected when the other conditions are met.

### Remediation

Upgrade to urllib3 2.8.0, in which the Deflate decoder stops accepting input after reaching the end of the compressed stream and no longer reports trailing bytes as data that can produce more decoded output.

If upgrading is not immediately possible, disable automatic content decoding for responses from untrusted sources by setting `decode_content=False`, or reject streamed responses using the Deflate content encoding. Applications that disable automatic decoding must handle the compressed response safely at another layer.

**References:**
- https://github.com/urllib3/urllib3/security/advisories/GHSA-gh4c-6fx4-qh6g
- https://nvd.nist.gov/vuln/detail/CVE-2026-97688
- https://github.com/urllib3/urllib3/commit/ea2ad7b21a80da3632f80016526a18864586077f
- https://github.com/urllib3/urllib3
- https://github.com/urllib3/urllib3/releases/tag/2.8.0

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-gh4c-6fx4-qh6g_

## Source
元記事: [CVE-2026-97688: urllib3: Chunked Deflate streaming can enter an infinite loop](https://osv.dev/vulnerability/GHSA-gh4c-6fx4-qh6g) — published 2026-09-30T15:00:38Z
