---
id: "CVE-2026-97689"
page: "https://infrastack.ai/live/CVE-2026-97689"
kind: "vulnerability"
aliases: ["CVE-2026-97689", "GHSA-vxq7-64xx-v4gw"]
title: "urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory"
severity: "high"
cvss: 8.9
epss: 0.00335
exploited: false
status: "open"
category: "package"
products: [{"name": "urllib3", "note": ">=1.10.3, <2.8.0", "fixed": ["2.8.0"], "affected": ">= 1.10.3, < 2.8.0", "ecosystem": "pypi"}, {"name": "python urllib3", "fixed": ["2.8.0"], "affected": ">= 1.10.3, < 2.8.0", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-770", "package", "python", "requests", "self-hosted", "urllib3"]
not_affected_if: ["non-streaming-reads", "trusted-servers-only"]
published_at: "2026-09-15T19:42:30+00:00"
first_seen_at: "2026-11-09T22:53:21+00:00"
updated_at: "2026-11-09T23:10:12+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/urllib3/urllib3/security/advisories/GHSA-vxq7-64xx-v4gw", "first_seen_at": "2026-11-09T22:53:21+00:00"}, {"source": "ghsa", "url": "https://github.com/advisories/GHSA-vxq7-64xx-v4gw", "first_seen_at": "2026-11-09T22:57:50+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-97689", "first_seen_at": "2026-11-09T23:10:12+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00335, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-97689"}]
---

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

Link for people: https://infrastack.ai/live/CVE-2026-97689 (this .md is for agents)

urllib3's stream() and read_chunked() methods buffer the chunk-size line of a chunked HTTP response until a newline arrives, with no size limit. A malicious server can send a long run of bytes without a newline, forcing the client to allocate excess memory before the response is rejected.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:urllib3 affected >= 1.10.3, < 2.8.0 fixed 2.8.0
- vendor:python urllib3 affected >= 1.10.3, < 2.8.0 fixed 2.8.0

## How to check

- Find the pinned version with `pip show urllib3` or `pip freeze | grep -i urllib3`
- Search code for `.stream(` or `.read_chunked(` calls on responses from untrusted hosts, including `requests` streaming with `stream=True`

## Fix

- urllib3 `2.8.0` or later (fixes affected range `>= 1.10.3, < 2.8.0`)
- If upgrading is not immediately possible, the advisory suggests reading the response at once with `read()` instead of streaming

## Timeline

- 2026-11-09T22:53:21+00:00 ghsa-repo https://github.com/urllib3/urllib3/security/advisories/GHSA-vxq7-64xx-v4gw
- 2026-11-09T22:57:50+00:00 ghsa https://github.com/advisories/GHSA-vxq7-64xx-v4gw
- 2026-11-09T23:10:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-97689

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/urllib3/urllib3/security/advisories/GHSA-vxq7-64xx-v4gw
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/urllib3/urllib3/security-advisories/GHSA-vxq7-64xx-v4gw
- [fix] Patch: github.com https://github.com/urllib3/urllib3/commit/cd770b059b543be29298ea5c52afb0b1b090f5ed
- [fix] Release: github.com https://github.com/urllib3/urllib3/releases/tag/2.8.0

## From the sources

## Impact

urllib3's [streaming API](https://urllib3.readthedocs.io/en/2.7.0/advanced-usage.html#streaming-and-i-o) is designed for efficiently handling large HTTP responses by reading the content in chunks, rather than loading the entire response body into memory at once. When decoding a [chunked-transfer-encoded response](https://httpwg.org/specs/rfc9112.html#chunked.encoding), this API reads each chunk's size field by buffering until it sees `\n` or EOF.

A malicious HTTP server can return `Transfer-Encoding: chunked` and then send a very long run of bytes without any newline, causing the streaming client to buffer that entire run before urllib3 can reject the chunk size as invalid and allocate more memory than intended.

To fix the issue, we'll reject chunk-size fields larger than 65536 bytes, as already done in the non-streaming case, which is currently handled by the Python standard library. Note that this only applies to reading the chunk-size field, not the chunk data, which is already handled correctly. As thus, we don't expect any impact for non-malicious servers.

## Affected usages

Applications and libraries using urllib3 versions earlier than 2.8.0 may be affected when streaming a chunked response from untrusted sources. Specifically, this affects the [read_chunked()](https://urllib3.readthedocs.io/en/stable/reference/urllib3.response.html#urllib3.response.BaseHTTPResponse.read_chunked) and [stream()](https://urllib3.readthedocs.io/en/stable/reference/urllib3.response.html#urllib3.response.BaseHTTPResponse.stream) methods of he HTTPResponse object.

This also affects requests streaming API, which uses urllib3 under the hood.

## Remediation

Upgrade to urllib3 version 2.8.0 or later, where chunk-size fields larger than 66536 will be rejected. If upgrading is not immediately possible, consider reading the response at once using the [read()](https://urllib3.readthedocs.io/en/stable/reference/urllib3.response.html#urllib3.response.BaseHTTPResponse.read) method.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
