NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-128124: AIOHTTP: Event loop stall in add_domain() wildcard matching

highCVSS 4.0 8.2GHSA-jm3w-gw2p-xjfj

aiohttp 3.14.3 and earlier can be stalled by a long Host header when the app registers a domain mask with two or more wildcards in Application.add_domain(). Matching takes polynomial time on the event loop. Upgrade to aiohttp 3.14.4, or use at most one * per mask.

Published Nov 16, 2026 · Analysis Nov 16, 2026

What an attacker can do

Application.add_domain() turned each * in a host mask into the regular expression [^:]*. With two or more wildcards, a long Host header that does not match the mask makes the regex engine try many splits, and the time grows polynomially with header length. The match runs on the asyncio event loop, so every other connection waits.

The attacker needs only network access and the ability to send HTTP requests with a long Host header. No login is needed. One or a few requests can freeze a single-process server, so this is a denial of service (CWE-1333). It does not expose data.

Only apps that call add_domain() with a multi-wildcard mask are exposed, for example a mask like *.*.example.com. Apps without add_domain(), or with a single wildcard, do not hit this path.

Who is affected

aiohttp <= 3.14.3, where application code calls add_domain() with a mask holding two or more * characters. Check the installed version:

pip show aiohttp

Then search your code for calls to add_domain and read the mask strings:

grep -rn add_domain .

aiohttp

Ecosystem
PyPI
Affected
<= 3.14.3
Fixed in
3.14.4
Check
pip show aiohttp

How to fix it

Upgrade to aiohttp 3.14.4:

pip install --upgrade aiohttp==3.14.4

Workaround from the advisory: use at most one * in a domain mask. You can also restrict Host header length at a reverse proxy in front of the app, though the advisory does not list that.

How to tell if you were hit

Watch for the event loop stalling: requests hanging, a Python worker pinned at full CPU, and timeouts on health checks. Check access logs or proxy logs for requests with very long Host headers just before the stall. Review the code for add_domain masks with more than one *.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Application.add_domain() compiled each * in a host mask to [^:]*. With two or more wildcards in a mask, matching a long Host header that does not match the mask took polynomial time on the event loop.

Impact

An attacker could stall a server that registers a domain mask with more than one wildcard by sending requests with a long Host header.

Workaround

Use at most one * in a domain mask.

---

Patch: https://github.com/aio-libs/aiohttp/commit/c6ac0e44c3c573ff9616f4a6a532992538b31e43

Credited to rodrigobnogueira, Dreamsorcerer.

Questions

Does CVE-2026-128124 affect all aiohttp servers?

No. It affects servers that call Application.add_domain() with a mask containing two or more wildcards, in aiohttp 3.14.3 and earlier.

What is the quickest mitigation?

Use at most one * in each domain mask. The permanent fix is aiohttp 3.14.4.

Can an attacker run code through this?

No. The impact is availability only: a long Host header makes regex matching slow and blocks the event loop.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More PyPI vulnerabilities

All PyPI entries