CVE-2026-128129
Unbounded memory use via unlimited buffering of upgrade request data in aiohttp.
- CVSS 8.2
- CWE-770
- Resource Management
- Remote
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.4, aiohttp buffers all additional connection data received while a request marked for upgrade, such as a WebSocket handshake, is being handled, without a size limit or flow control. A remote attacker can stream data behind an upgrade request to a handler that does not immediately accept or reject the upgrade and cause unbounded memory consumption. This issue is fixed in version 3.14.4.
- CWE
- CWE-770
- CVSS base score
- 8.2
- Published
- 2026-11-13
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Missing Check
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- aiohttp
- Fixed by upgrading
- Yes
Solution
Upgrade aiohttp to version 3.14.4 or newer.
Vulnerable code sample
import aiohttp.web
async def handler(request: aiohttp.web.Request) -> aiohttp.web.Response:
# VULNERABLE: unbounded buffering of upgrade data
data = await request.content.read() # reads all pending bytes
# Simulate processing of upgrade request
if b'Upgrade: websocket' in data:
# Deliberately delay acceptance to trigger buffering
await aiohttp.web.Response(status=101).prepare(request)
# No further reads; buffered data grows unbounded
return aiohttp.web.Response(text="OK")
app = aiohttp.web.Application()
app.add_routes([aiohttp.web.get('/', handler)])Patched code sample
import aiohttp.web
async def handler(request: aiohttp.web.Request) -> aiohttp.web.Response:
# FIX: limit buffered data while waiting for upgrade
max_buffer = 1024 * 1024 # 1 MiB
data = await request.content.read(max_buffer + 1)
if len(data) > max_buffer:
return aiohttp.web.Response(status=413, text="Payload too large")
if b'Upgrade: websocket' in data:
await aiohttp.web.Response(status=101).prepare(request)
return aiohttp.web.Response(text="OK")
app = aiohttp.web.Application()
app.add_routes([aiohttp.web.get('/', handler)])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.
- Fix limit on message tail (#13501) (#13511) (aio-libs/aiohttp)
aiohttp/web_protocol.py,aiohttp/web_protocol.py · RequestHandler.data_received,aiohttp/web_protocol.py · RequestHandler.finish_response,aiohttp/web_protocol.py · RequestHandler.set_parser,aiohttp/web_protocol.py · RequestHandler._resume_msg_queue_reading,aiohttp/web_protocol.py · RequestHandler.__init__ - Fix limit on message tail (#13501) (aio-libs/aiohttp)
aiohttp/web_protocol.py · RequestHandler.finish_response,aiohttp/web_protocol.py · RequestHandler.__init__
Cite this entry
@misc{vaitp:cve2026128129,
title = {{Unbounded memory use via unlimited buffering of upgrade request data in aiohttp.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128129},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128129/}}
}
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 ::
