CVE-2026-128124
AIOHTTP multi‑wildcard domain masks cause regex‑based DoS via long Host headers.
- CVSS 8.2
- CWE-1333
- Resource Management
- Remote
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.4, Application.add_domain() converts every asterisk wildcard in a domain mask into a greedy regular-expression fragment, so a mask containing two or more wildcards can take polynomial time to reject a long Host header that does not match. A remote attacker can repeatedly send such headers to a server configured with a multi-wildcard domain mask and stall the event loop. This issue is fixed in version 3.14.4.
- CWE
- CWE-1333
- CVSS base score
- 8.2
- Published
- 2026-11-13
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Timing Issues
- 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 asyncio
from aiohttp import web
# VULNERABLE: greedy wildcard conversion in add_domain
app = web.Application()
app.add_domain("*.example.*") # domain mask with multiple wildcards
async def hello(request):
return web.Response(text="Hello, world!")
app.add_routes([web.get('/', hello)])
async def run():
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, '0.0.0.0', 8080)
await site.start()
while True:
await asyncio.sleep(3600)
asyncio.run(run())Patched code sample
import asyncio
import re
from aiohttp import web
# FIX: use precompiled safe regex instead of wildcard mask
app = web.Application()
app.add_domain(re.compile(r"^[^.]+\.example\.[^.]+$")) # safe domain pattern
async def hello(request):
return web.Response(text="Hello, world!")
app.add_routes([web.get('/', hello)])
async def run():
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, '0.0.0.0', 8080)
await site.start()
while True:
await asyncio.sleep(3600)
asyncio.run(run())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.
- Improve performance of domain matching (#13943) (aio-libs/aiohttp)
aiohttp/web_urldispatcher.py,aiohttp/web_urldispatcher.py · MaskDomain.canonical,aiohttp/web_urldispatcher.py · MaskDomain.match_domain,aiohttp/web_urldispatcher.py · MaskDomain.__init__
Cite this entry
@misc{vaitp:cve2026128124,
title = {{AIOHTTP multi‑wildcard domain masks cause regex‑based DoS via long Host headers.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128124},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128124/}}
}
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 ::
