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

CVE-2026-128128: AIOHTTP: WebSocket max_msg_size bypass via integer overflow

highCVSS 3.1 7.5GHSA-3rp8-rxj8-mvjw

aiohttp 3.14.3 and earlier lets a WebSocket peer bypass max_msg_size through an integer overflow in the C extension reader. Streaming an oversized message after a small fragment causes unbounded memory use. Upgrade to aiohttp 3.14.4, or run the pure-Python reader.

Published Nov 16, 2026 · Analysis Nov 16, 2026

What an attacker can do

The WebSocket reader checks max_msg_size by adding the declared frame length to the size of the partial message already buffered. In the C extension this is 64-bit arithmetic. A declared length close to 2**63 overflows, so the sum wraps and the check passes.

The attacker opens a WebSocket connection, sends a small non-final fragment, then streams an oversized message. The server keeps buffering it without the intended cap. Memory grows until the process slows or is killed.

The attacker needs only the ability to connect to a WebSocket endpoint served by aiohttp. No login is needed unless the app adds one before the upgrade. The flaw affects availability only. The advisory says the pure-Python reader is not affected.

Who is affected

aiohttp <= 3.14.3 that uses the C extension, with a WebSocket server endpoint. The pure-Python reader is unaffected. Check the version:

pip show aiohttp

Check whether the C extension is in use. If AIOHTTP_NO_EXTENSIONS is set to 1, the Python reader is used:

env | grep AIOHTTP_NO_EXTENSIONS

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, if you cannot upgrade: set AIOHTTP_NO_EXTENSIONS=1 so aiohttp uses the Python reader. That reader is slower than the C extension, so test the effect on throughput first.

How to tell if you were hit

Watch for memory growth on processes that serve WebSockets, OOM kills, and connections that stay open while sending a very large message. Look in proxy or application logs for a single WebSocket client that transfers far more data than your normal messages. The advisory names no log line.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The max_msg_size check in the WebSocket reader added the declared frame length to the size of the partial message already buffered. In the C extension this addition is 64-bit arithmetic, so a declared length close to 2**63 overflowed and the check passed.

Impact

An attacker could bypass max_msg_size and cause unbounded memory use by streaming an oversized WebSocket message after a small non-final fragment.

Workaround

If unable to upgrade, the Python reader is unaffected and can be used with AIOHTTP_NO_EXTENSIONS=1.

---

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

Credited to axel-mierczuk-1pw, Dreamsorcerer.

Questions

Is the pure-Python WebSocket reader affected by CVE-2026-128128?

No. The advisory says the Python reader is unaffected, and setting AIOHTTP_NO_EXTENSIONS=1 selects it as a workaround.

Why does the max_msg_size check pass?

The C extension adds the declared frame length to the buffered size in 64-bit arithmetic. A length near 2**63 overflows, so the check passes.

Which version fixes it?

aiohttp 3.14.4. Versions through 3.14.3 are affected.

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