CVE-2026-137016
Description
## Summary RabbitMQ enables WebSocket `permessage-deflate` before STOMP authentication. The unauthenticated WebSocket frame-size limit applies to each decompressed WebSocket message independently, but the STOMP parser can accumulate one incomplete STOMP body across thousands of WebSocket messages. An unauthenticated client can declare a large STOMP `content-length`, then send many highly compressible 60 KiB WebSocket messages without completing the STOMP frame. Parser continuations retain the decompressed body chunks up to the default 100 MiB STOMP body limit per connection. The retained data is primarily off-heap binary memory, so RabbitMQ's 16 MiB unauthenticated process-heap limit does not terminate the connection. A small number of connections can exhaust the broker before the normal 10-second login timeout closes them. ## Preconditions - `rabbitmq_web_stomp` is enabled. - TCP port 15674, or an equivalent configured Web STOMP listener, is reachable. - The listener negotiates `permessage-deflate`, as it does by default. - No valid RabbitMQ credentials are required. ## Root cause ### 1. Compression is enabled before authentication ```erlang %% deps/rabbitmq_web_stomp/src/rabbit_web_stomp_handler.erl:119-135 MaxFrameSize = application:get_env( rabbitmq_stomp, max_frame_size_unauthenticated, ?DEFAULT_MAX_FRAME_SIZE_UNAUTHENTICATED) + 4096, WsOpts = maps:merge(#{compress => true, max_frame_size => MaxFrameSize}, WsOpts0), ``` The frame-size setting limits one decompressed WebSocket message, not aggregate STOMP parser state. ### 2. Parser state survives across WebSocket messages `rabbit_web_stomp_handler:handle_data1/2` stores the STOMP parser continuation when a complete frame has not arrived and invokes it with the next WebSocket message. The body parser in `rabbit_stomp_frame.erl` retains every body chunk until the declared `content-length` is complete. The default maximum STOMP body is 100 MiB, so one unauthenticated connection can retain close to 100 MiB while each individual WebSocket message remains under the 64 KiB pre-auth limit. ### 3. The process heap limit does not account for retained binary memory RabbitMQ applies a 16 MiB `max_heap_size` to unauthenticated connection processes. Large decompressed binaries are reference-counted off-heap; only small references are charged to the Erlang process heap. The process therefore survives while retaining substantially more than 16 MiB of broker memory. ## Basic Python proof of concept Attachment: `web-stomp-preauth-memory-dos-poc.py` The attachment is one Python 3 file using only the standard library. It implements the WebSocket upgrade, masking, `permessage-deflate`, and STOMP framing directly. Target setup: ```bash rabbitmq-plugins enable rabbitmq_web_stomp ``` Bounded one-connection validation: ```bash python3 web-stomp-preauth-memory-dos-poc.py \ --host rabbitmq.example --port 15674 --path /ws \ --connections 1 --retain-mib 64 --hold-seconds 5 ``` Expected output: ```text sending incomplete compressed STOMP frames before authentication filling connection 1/1 retained body sent: 60 MiB holding 64 MiB declared body fragments for 5s connections_alive_after_hold=1/1 compressed_websocket_bytes_sent=91829 MEMORY_PIN_SENT ``` This transmits approximately 92 KB over the network and retains 64 MiB of decompressed STOMP body state. Stress setting for a disposable test server: ```bash python3 web-stomp-preauth-memory-dos-poc.py \ --host 127.0.0.1 --port 15674 \ --connections 5 --retain-mib 64 --hold-seconds 2 ``` Do not use the stress setting against a production broker. ## Verified results ### Bounded memory measurement RabbitMQ 4.3.4 in a 1 GiB container: ```text connections: 1 decompressed body retained: 64 MiB compressed WebSocket bytes sent: 91,829 container memory before: 178.4 MiB container memory during hold: 262.3 MiB broker ping: succeeded ``` The broker consumed approxi
CVSS Base Scores
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Affected Products
| Vendor | Product | Version | Status |
|---|---|---|---|
| RabbitMQ | — | — |


