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

Published Sep 29, 2026
·
Updated

Impact

urllib3's streaming API 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, 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. Thus, there shouldn't be 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 readchunked() and stream() methods of the 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 65536 will be rejected. If upgrading is not immediately possible, consider reading the response at once using the read() method.

Other sources

urllib3 is an HTTP client library for Python. From 1.10.3 until 2.8.0, the HTTPResponse.readchunked and HTTPResponse.stream methods can allocate unbounded memory because the streaming chunk parser buffers the chunk-size field until newline or EOF without a length bound. The trigger is that a malicious server returns Transfer-Encoding: chunked followed by a very long run of bytes without a newline. The attack mechanism is that a malicious HTTP server sends a very long unterminated chunk-size line. The impact is that unbounded memory allocation can exhaust the client process. This issue is fixed in version 2.8.0.

— MITRE

Affected Software

2 affected componentsFixes available
pypi/urllib3>=1.10.3<2.8.0
pip/urllib3>=1.10.3<2.8.0
2.8.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/urllib3 to a version that resolves this vulnerability.

    Fixed in 2.8.0
  2. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 2.8.0
  3. Compensating control

    If upgrading is not immediately possible, read the response at once using the read() method instead of the streaming read_chunked() or stream() methods.

Event History

Sep 29, 2026
CVE Published
via MITRE·03:36 PM
Data Sourced
via MITRE·03:36 PM
DescriptionWeakness
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness
Sep 30, 2026
Advisory Published
via GitHub·02:46 PM
Data Sourced
via GitHub·02:46 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using urllib3 versions from 1.10.3 up to, but not including, 2.8.0 are exposed when they use HTTPResponse.read_chunked() or HTTPResponse.stream() against a malicious HTTP server.

2

What must an attacker control to trigger the memory exhaustion?

An attacker needs to operate or control an HTTP server that the affected client connects to. The server must send Transfer-Encoding: chunked and then provide an extremely long chunk-size line without a newline or EOF.

3

How can I determine whether an application is affected?

Check whether the application depends on an urllib3 version in the affected range and whether it processes responses from untrusted or potentially malicious HTTP servers through HTTPResponse.read_chunked() or HTTPResponse.stream().

4

What is the remediation?

Upgrade urllib3 to version 2.8.0, which fixes the unbounded buffering of the chunk-size field.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203