VAITP Dataset

← Back to the dataset

CVE-2026-97689

Unbounded memory allocation in urllib3 chunked response parsing (CVE‑2024‑xxxx).

  • CVSS 8.9
  • CWE-770
  • Resource Management
  • Remote

urllib3 is an HTTP client library for Python. From 1.10.3 until 2.8.0, the HTTPResponse.read_chunked 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.

CVSS base score
8.9
Published
2026-09-29
OWASP
A04 Insecure Design
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
urllib3
Fixed by upgrading
Yes

Solution

Upgrade urllib3 to version 2.8.0 (or later).

Vulnerable code sample

import urllib3

def fetch(url):
    http = urllib3.PoolManager()
    resp = http.request('GET', url, preload_content=False)
    # VULNERABLE: unbounded buffering of chunk-size line
    data = b''.join(resp.read_chunked())
    resp.release_conn()
    return data

Patched code sample

import urllib3

def fetch(url):
    http = urllib3.PoolManager()
    resp = http.request('GET', url, preload_content=False)
    # FIX: limit memory by streaming with a maximum total size
    max_total = 10 * 1024 * 1024  # 10 MiB
    total = 0
    chunks = []
    for chunk in resp.stream(chunk_size=8192):
        total += len(chunk)
        if total > max_total:
            resp.release_conn()
            raise MemoryError('Response exceeds safe size')
        chunks.append(chunk)
    resp.release_conn()
    data = b''.join(chunks)
    return data

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Merge commit from fork (urllib3/urllib3)
    src/urllib3/response.py, src/urllib3/response.py · HTTPResponse.read_chunked, src/urllib3/response.py · HTTPResponse._update_chunk_length

Cite this entry

@misc{vaitp:cve202697689,
  title        = {{Unbounded memory allocation in urllib3 chunked response parsing (CVE‑2024‑xxxx).}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-97689},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-97689/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.