CVE-2026-128125
Memory‑exhaustion via unbounded Cookie parsing in aiohttp < 3.14.4.
- CVSS 6.3
- CWE-1325
- Resource Management
- Remote
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.4, Set-Cookie parsing treats unrecognized name=value attributes as additional cookies, while CookieJar does not limit the number of cookies stored or sent. A malicious server can make an aiohttp client accumulate a very large cookie set, consume memory and CPU repeatedly across redirects, and construct an excessively large Cookie header for later requests to the same domain. This issue is fixed in version 3.14.4.
- CWE
- CWE-1325
- CVSS base score
- 6.3
- Published
- 2026-11-13
- OWASP
- A05 Security Misconfiguration
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Resource Management
- Subcategory
- Memory Leaks
- 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
import asyncio
# VULNERABLE: unlimited cookie accumulation across redirects
async def fetch(url: str) -> str:
async with aiohttp.ClientSession() as session:
async with session.get(url, allow_redirects=True) as resp:
return await resp.text()
# Example coroutine (not executed)
async def example():
await fetch("http://example.com")Patched code sample
import aiohttp
import asyncio
# FIX: limit cookie jar size to prevent unbounded growth
async def fetch(url: str) -> str:
jar = aiohttp.CookieJar(max_cookies=50)
async with aiohttp.ClientSession(cookie_jar=jar) as session:
async with session.get(url, allow_redirects=True) as resp:
return await resp.text()
async def example():
await fetch("http://example.com")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.
- [PR #13930/b1f6c87b backport][3.14] Add limits for client cookie handling (#13942) (aio-libs/aiohttp)
aiohttp/client.py,aiohttp/client.py · ClientSession._request,aiohttp/cookiejar.py,aiohttp/cookiejar.py · CookieJar.clear,aiohttp/cookiejar.py · CookieJar.filter_cookies,aiohttp/cookiejar.py · CookieJar.load,aiohttp/cookiejar.py · CookieJar.update_cookies_from_headers,aiohttp/cookiejar.py · CookieJar._delete_cookies,aiohttp/cookiejar.py · CookieJar._do_expiration,aiohttp/cookiejar.py · CookieJar._load_json_data,aiohttp/cookiejar.py · CookieJar._update_cookies,aiohttp/cookiejar.py · CookieJar.__init__and 5 more - Add limits for client cookie handling (#13930) (aio-libs/aiohttp)
aiohttp/client.py,aiohttp/client.py · ClientSession._request,aiohttp/cookiejar.py,aiohttp/cookiejar.py · CookieJar.filter_cookies,aiohttp/cookiejar.py · CookieJar.load,aiohttp/cookiejar.py · CookieJar._load_json_data,aiohttp/cookiejar.py · CookieJar.__init__,aiohttp/_cookie_helpers.py · parse_cookie_header
Cite this entry
@misc{vaitp:cve2026128125,
title = {{Memory‑exhaustion via unbounded Cookie parsing in aiohttp < 3.14.4.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128125},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128125/}}
}
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 ::
