CVE-2026-128131
Quadratic decompression DoS via concatenated gzip/deflate/zstd streams.
- CVSS 8.7
- CWE-400
- Resource Management
- Remote
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.4, aiohttp decompresses each member of a payload containing many concatenated gzip, deflate, or zstd streams by passing the entire remaining input to a new decompressor, causing quadratic CPU use. Empty members produce no output, so client_max_size and output backpressure do not limit the work. A remote attacker can block a server event loop with a crafted compressed request body or WebSocket message, and a malicious server can similarly block a client. This issue is fixed in version 3.14.4.
- CWE
- CWE-400
- CVSS base score
- 8.7
- Published
- 2026-11-13
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- 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 later.
Vulnerable code sample
import aiohttp
from aiohttp import web
import zlib
async def handle(request):
# VULNERABLE: creates a new decompressor for each chunk, causing quadratic work
decompressed = bytearray()
async for chunk in request.content.iter_chunked(1024):
# each iteration restarts decompression on the whole remaining stream
decomp = zlib.decompressobj()
decompressed.extend(decomp.decompress(chunk))
decompressed.extend(decomp.flush())
return web.Response(body=decompressed)
app = web.Application()
app.router.add_post('/upload', handle)Patched code sample
import aiohttp
from aiohttp import web
import zlib
async def handle(request):
# FIX: reuse a single decompressor for the whole stream
decompressed = bytearray()
decomp = zlib.decompressobj()
async for chunk in request.content.iter_chunked(1024):
decompressed.extend(decomp.decompress(chunk))
decompressed.extend(decomp.flush())
return web.Response(body=decompressed)
app = web.Application()
app.router.add_post('/upload', handle)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 excessive CPU use on decompressing small members (#13362) (aio-libs/aiohttp)
aiohttp/compression_utils.py,aiohttp/compression_utils.py · ZLibDecompressor.decompress_sync,aiohttp/compression_utils.py · ZLibDecompressor.__init__,aiohttp/compression_utils.py · ZSTDDecompressor.data_available,aiohttp/compression_utils.py · ZSTDDecompressor.decompress_sync,aiohttp/compression_utils.py · ZSTDDecompressor.__init__,aiohttp/_websocket/reader_py.py,aiohttp/_websocket/reader_py.py · WebSocketReader._handle_frame - [PR #13362/d041d4d0 backport][3.14] Fix excessive CPU use on decompressing small members (#13391) (aio-libs/aiohttp)
aiohttp/compression_utils.py,aiohttp/compression_utils.py · ZSTDDecompressor.decompress_sync,aiohttp/_websocket/reader_py.py · WebSocketReader._handle_frame
Cite this entry
@misc{vaitp:cve2026128131,
title = {{Quadratic decompression DoS via concatenated gzip/deflate/zstd streams.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128131},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128131/}}
}
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 ::
