CVE-2026-116579: Autobahn Python: permessage-brotli inflates a whole frame before maxMessagePayloadSize is checked (incomplete fix of GHSA-hxp9-w8x3-p566)
Autobahn Python 26.7.1 up to 26.10.0 inflates each permessage-brotli frame in full before it checks maxMessagePayloadSize. One 421-byte WebSocket frame makes the server allocate about 545 MiB, even with a 1 MiB limit. An unauthenticated client can exhaust memory on servers that enable permessage-brotli. Fixed in 26.10.1.
Published Oct 28, 2026 · Analysis Nov 1, 2026
What an attacker can do
This is an incomplete fix of GHSA-hxp9-w8x3-p566. In 26.7.1 the receive path passes the remaining maxMessagePayloadSize budget to decompress_message_data(..., max_output_len=...). The deflate and bzip2 backends stop at that budget. PerMessageBrotli.decompress_message_data in compress_brotli.py does not. It calls self._decompressor.process(data) with no limit and compares the length afterwards.
Brotli expands at about 1,000,000:1, so 841 bytes can inflate to 1 GiB. The code comment says the frame is bounded by maxFramePayloadSize, but that bound means little at this ratio. In the reporter's test, an asyncio server with maxFramePayloadSize=64 KiB and maxMessagePayloadSize=1 MiB peaked at 545 MiB from a 28 MiB baseline after one small frame, then rejected it with code 1009.
An attacker needs only a WebSocket connection to a server that enabled permessage-brotli. That option is opt-in and needs the compress extra. A few concurrent connections can exhaust memory. Only availability is affected.
Who is affected
Autobahn versions >= 26.7.1, < 26.10.1 on servers that enable the permessage-brotli extension. Servers that never negotiate brotli are not exposed. The report was tested with brotli 1.2.0.
Check your versions:
pip show autobahn brotliAlso check your server code for PerMessageBrotliOffer or PerMessageBrotliAccept settings.
autobahn
- Ecosystem
- PyPI
- Affected
- >= 26.7.1, < 26.10.1
- Fixed in
- 26.10.1
- Check
pip show autobahn
How to fix it
Upgrade to autobahn 26.10.1:
pip install --upgrade "autobahn>=26.10.1"The report notes that brotli 1.2.0 and later has Decompressor.process(data, output_buffer_limit=N), which lets the backend stop at the output budget as deflate and bzip2 do. The sources we read give no other workaround. Until you upgrade, you can stop offering permessage-brotli on your WebSocket servers.
How to tell if you were hit
Look for sudden resident-memory spikes in the WebSocket server process that follow a small incoming frame, and for out-of-memory kills. Servers log a close with code 1009 (message too big) after the allocation, so repeated 1009 closes from one client alongside memory jumps point to this. Check handshake logs for clients that negotiate permessage-brotli.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
permessage-brotli inflates each frame fully before checking maxMessagePayloadSize, so one 421-byte frame makes the server allocate about 545 MiB even with a 1 MiB message limit (brotli expands about 1,000,000:1). Any unauthenticated client can exhaust server memory this way on servers that enable permessage-brotli. This bypasses the GHSA-hxp9-w8x3-p566 fix.
Details
In 26.7.1 the receive path passes the remaining maxMessagePayloadSize budget to decompress_message_data(..., max_output_len=...). deflate and bzip2 stop at that budget. PerMessageBrotli.decompress_message_data (compress_brotli.py) instead calls self._decompressor.process(data) with no limit and compares the length afterwards, so the whole frame is inflated first.
The code comment and changelog say this is still "bounded on the wire by maxFramePayloadSize", but brotli reaches about 1,000,000:1 (841 bytes inflate to 1 GiB), so that bound means little. A 421-byte frame against a 1 MiB budget peaks at 545 MiB before the 1009 rejection.
An autobahn asyncio server on 127.0.0.1 accepting permessage-brotli, with maxFramePayloadSize=64 KiB and maxMessagePayloadSize=1 MiB, received one small brotli frame from an autobahn client and peaked at 545 MiB (baseline 28 MiB). A few concurrent connections can exhaust memory.
brotli ≥ 1.2.0 has Decompressor.process(data, output_buffer_limit=N), so the backend can stop at max_output_len like deflate and bzip2 (and the extra's floor can be raised to brotli>=1.2.0).
Tested on autobahn 26.7.1 (latest) with brotli 1.2.0; compress_brotli.py on master is unchanged. This affects servers that enable permessage-brotli (opt-in, needs the compress extra).
Proof of concept
How to run the PoC
python3 -m venv venv && . venv/bin/activate
pip install autobahn==26.7.1 brotli==1.2.0
python3 poc_autobahn.py# PoC: autobahn 26.7.1 permessage-brotli inflates a whole frame before maxMessagePayloadSize is checked.
import brotli, resource
from autobahn.websocket.compress import PerMessageBrotli
c = brotli.Compressor() # build a 256 MiB-of-zeros frame without holding the plaintext
frame = b"".join(c.process(b"\0" * (1 << 20)) for _ in range(256)) + c.finish()
pmce = PerMessageBrotli(is_server=True, server_no_context_takeover=False, client_no_context_takeover=False)
pmce.start_decompress_message()
print(len(frame), "bytes on the wire; peak RSS before:", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss >> 10, "MiB")
try:
pmce.decompress_message_data(frame, max_output_len=1 << 20) # remaining budget: 1 MiB
except Exception as e:
print(type(e).__name__, "| peak RSS after:", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss >> 10, "MiB")Output:
421 bytes on the wire; peak RSS before: 36 MiB
PayloadExceededError | peak RSS after: 545 MiBImpact
An unauthenticated WebSocket client can make a server that enabled permessage-brotli allocate hundreds of MB or more per tiny frame, regardless of the configured maxMessagePayloadSize. That is the memory-exhaustion DoS GHSA-hxp9-w8x3-p566 was meant to prevent.
Credit goes to Adrian Korwel.
Credited to adriank31.
Questions
- Is my Autobahn server affected if I do not use brotli?
No. The flaw is in the permessage-brotli path, which is opt-in and needs the compress extra. Deflate and bzip2 respect the message size limit.
- Does maxMessagePayloadSize protect me?
Not on affected versions. The limit is checked only after the whole frame is inflated, so memory is already allocated by then.
- Does the attacker need to log in?
No. Any unauthenticated WebSocket client that can negotiate permessage-brotli can send the frame.
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
