Mosquitto 2.1.0–2.1.2 allows pre-auth RCE via websockets
The built-in websockets path is vulnerable; upgrading to 2.1.4 is the stated fix.
Unauthenticated RCE in Mosquitto WebSocket listeners
Eclipse Mosquitto 2.1 through 2.1.2 mishandles empty WebSocket data frames on a listener set to protocol websockets. An unauthenticated remote client can trigger this before any authentication check, including when allow_anonymous is false. The broker may disclose uninitialized heap memory (including heap and libc pointers) and suffer a heap out-of-bounds write that can crash it or yield remote code execution as the broker user.
What to do: Apply Eclipse’s update for CVE-2026-110486 when one is published; no fixed version is stated.
| Product | Affected |
|---|---|
| Eclipse Mosquitto | 2.1 through 2.1.2 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
In Eclipse Mosquitto versions 2.1 through 2.1.2, a listener configured with `protocol websockets` mishandles empty WebSocket data frames. `net__read_ws()` in `lib/net_ws.c` returns the number of framing bytes consumed (the 4 masking-key bytes) for a data frame with a zero-length payload, without writing any bytes to the caller’s buffer. The MQTT packet reader in `packet__read_single()` (`lib/packet_mosq.c`) trusts that return value as a payload byte count. A remote client can therefore advance the read position over an uninitialised heap allocation, causing the broker to process and forward uninitialised heap memory (information disclosure, including heap and libc pointers), and can underflow the unsigned `to_process` counter so that subsequent attacker-controlled frame data is written past the end of the allocation (heap out-of-bounds write). The out-of-bounds write is reachable from the CONNECT packet before any authentication check, so an unauthenticated client can corrupt the heap and crash the broker even when `allow_anonymous false` is set. Combining the disclosure and the write allows remote code execution as the broker’s user by any client able to establish a session.
The built-in websockets path is vulnerable; upgrading to 2.1.4 is the stated fix.
Today 2.4K readers · 2.6K views · 142 reads · all time 206K views