CVE-2026-110486: Remote heap out-of-bounds read/write in Eclipse Mosquitto
In Eclipse Mosquitto versions 2.1 through 2.1.2, a listener configured with protocol websockets mishandles empty WebSocket data frames. netreadws() in lib/netws.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 packetreadsingle() (lib/packetmosq.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 toprocess 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 allowanonymous 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.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Only Mosquitto versions 2.1 through 2.1.2 with a listener configured to use `protocol websockets` are described as affected. An attacker must be able to establish a session with that WebSocket listener.
Does disabling anonymous MQTT access prevent exploitation?
No. The out-of-bounds write can be reached through a CONNECT packet before authentication is checked, so `allow_anonymous false` does not prevent an unauthenticated client from corrupting the broker heap or crashing the broker.
What can an attacker do with successful exploitation?
An attacker can disclose uninitialised heap memory, including heap and libc pointers, corrupt heap memory with an out-of-bounds write, crash the broker, and potentially execute code as the broker’s user.
What is the available mitigation if patching cannot happen immediately?
Remove or disable listeners configured with `protocol websockets`, or otherwise prevent untrusted clients from establishing sessions with those listeners. The described vulnerable path requires a WebSocket listener and client connectivity to it.