Introduction
An empty WebSocket frame, the kind RFC 6455 explicitly allows, is enough to corrupt the heap of an Eclipse Mosquitto broker before any client has authenticated. For the many IoT and embedded deployments that expose MQTT over WebSockets, CVE-2026-110486 turns a single malformed frame into pre-authentication information disclosure, a heap out-of-bounds write, and, as public research demonstrates, remote code execution as the broker user.
Eclipse Mosquitto is an open source MQTT message broker licensed under EPL and EDL that implements MQTT 5.0, 3.1.1, and 3.1. It is light enough for low power and embedded devices as well as full servers, and the project names IoT messaging across sensors and embedded devices as a central use case. It sits under the Eclipse Foundation and Eclipse IoT ecosystem, with development driven by Cedalo, which makes it a common component in embedded products.
Technical Information
The root cause is one variable doing two jobs. In Mosquitto 2.1.0 through 2.1.2, net__read_ws() in lib/net_ws.c used a single ssize_t len to track both the bytes consumed for each part of the WebSocket header (the opcode byte, the length byte, the extended length, and the 4-byte masking key) and the number of MQTT payload bytes copied into the caller's buffer. The caller, packet__read_single() in lib/packet_mosq.c, treats the return value as the number of new MQTT bytes it received.
RFC 6455 allows an empty data frame. When one arrives, the payload-copy block is skipped because payloadlen == 0. None of the completion branches that reset len match either: the frame is neither CLOSE nor PONG, and there is no out_packet. As public issue #3704 explains, the function therefore returns whatever the last header read left in len. For a masked client frame, that is the 4 bytes consumed reading the masking key. The MQTT layer then counts 4 bytes as received when none were written.
The root-cause trace reported in issue #3704 runs read_ws_opcode to read_ws_payloadlen_short to read_ws_mask, which leaves len == 4. That value leaks out as the return value.
From miscount to memory corruption
The miscount breaks the reader's to_process and pos bookkeeping. With to_process == 1, an empty masked frame makes it 1 - 4 = 0xfffffffd, an unsigned 32-bit underflow of roughly 4 GiB, while pos advances past the end of the heap payload allocation. This is a pre-auth relative heap out-of-bounds write reachable before any valid CONNECT completes.
Two distinct impacts follow. First, the broker may process and forward uninitialized heap memory, disclosing content that can include heap and libc pointers (CWE-908). Second, the underflowed counter lets subsequent attacker-controlled frame data be written beyond the allocation (CWE-191 feeding CWE-787). Both are reachable while processing a CONNECT packet, before authentication, so setting allow_anonymous false does not remove the attack path.
The published CVSS vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, scored 9.8.
Attack flow
Based on the briefing and public research, exploitation proceeds roughly as follows:
- The attacker completes a WebSocket upgrade to the broker's WebSocket endpoint (for example
ws://host:port/mqtt). - The attacker begins a CONNECT packet that declares a remaining length of one or more payload bytes but withholds the final bytes.
- The attacker sends an empty masked WebSocket data frame. The broker credits four phantom bytes it never wrote, underflowing
to_processand advancingpospast the buffer. - The attacker sends further masked frame data, which is written past the end of the one-byte heap allocation, or, in a disclosure-oriented variant, declares a large remaining length and uses repeated empty frames to make the broker forward stale heap bytes to a subscriber.
Proof of Concept
Public proof-of-concept evidence exists at two levels: a fully public, self-contained trigger and crash reproducer, and two independent, documented pre-auth RCE exploitation chains whose methodology is published while full weaponized scripts are withheld pending coordinated disclosure.
Public trigger and DoS reproducer (issue #3704)
A complete Python 3 standard-library reproducer is published in GitHub issue #3704 (UWCSZhou, 10 Aug 2026). It is a session-wedging and framing-corruption PoC, and the reporter initially believed there was no memory-safety impact. The broker config to reproduce is:
listener 1884 127.0.0.1
protocol websockets
allow_anonymous true
persistence false
The script performs a WebSocket upgrade to ws://127.0.0.1:1884/mqtt, sends a masked CONNECT and SUBSCRIBE, then the trigger and a PINGREQ:
def ws(payload, opcode=0x2): # masked client frame b = bytes([0x80 | opcode]); n = len(payload); k = os.urandom(4) if n < 126: b += bytes([0x80 | n]) else: b += bytes([0x80 | 126]) + struct.pack("!H", n) return b + k + bytes(c ^ k[i % 4] for i, c in enumerate(payload)) ... sock.sendall(ws(b"")) # <-- the trigger: empty frame time.sleep(0.2); sock.sendall(ws(PINGREQ)); sock.settimeout(1.0)
Expected output is session established: CONNACK=True SUBACK=True followed by after empty frame + PINGREQ: NO RESPONSE (session wedged). The issue also contains the precise root-cause trace and a suggested fix.
Minimal three-frame memory-corruption trigger
Both the born0monday write-up and DZONERZY's MASKerade write-up publish the same minimal pre-auth heap-overflow trigger: three masked WebSocket frames, with no valid MQTT packet ever completed.
sock.sendall(masked_frame(b"\x10\x01")) # CONNECT, Remaining Length = 1, body withheld sock.sendall(masked_frame(b"")) # masked empty frame -> returns 4, copies 0 sock.sendall(masked_frame(b"A" * 256)) # written at payload+4, past the 1-byte buffer
Compiled under AddressSanitizer, this yields a confirmed heap-buffer-overflow "3 bytes to the right of 1-byte region" inside net__read_ws (lib/net_ws.c) and packet__read_single (lib/packet_mosq.c). A disclosure-primitive variant declares a PUBLISH with a large remaining length but sends only 3 real bytes, then sends N empty frames (each contributing 4 phantom bytes) to make the broker forward uninitialized stale heap to a subscriber.
Documented full pre-auth RCE chains
born0monday ("Pwning Home Assistant Green", 4 Nov 2026, aarch64 HA add-on on tcp/1884) and DZONERZY ("MASKerade, Phantom Bytes, Real Shell", x86-64, default-deny config) each independently built end-to-end pre-auth RCE. The documented primitive chain uses a PINGREQ/PONG heap spray in a matching size class, overwrites a queued packet's to_process to turn the OOB write into a large OOB read for an ASLR and heap leak, then corrupts a second connection's in_packet.payload pointer for an arbitrary write. born0monday uses an A/B/C "context ring" for repeatable, self-healing writes, forges base_msg/client_msg and promotes a parked context to mosq_cs_active with a forged bridge and client-id to bypass auth, obtains arbitrary read via a forged QoS1 PUBLISH, and finishes with a GOT overwrite of strncmp@GOT to system, invoked via a $CONTROL/ prefix check in handle__publish so system(topic) runs. DZONERZY defeats full RELRO, NX, PIE, and safe-linking via tcache poisoning, cross-identifies uthash metadata against safe-linking to recover addresses, leaks PIE through a static "client context" string, forges the plugin__handle_tick callback chain to call the binary's own imported dlsym (resolving setcontext then a ROP chain to system("sh >&0 2>&0")), and reaches an interactive shell as uid=1001(broker) with zero credentials.
Availability caveat
The complete weaponized exploit scripts are not yet publicly downloadable. born0monday published part 1 (bug and RCE methodology) with a part 2 on container escape pending, and DZONERZY states the PoCs will be released once coordinated disclosure runs its course. A working public trigger and crash reproducer (issue #3704), exact byte-level trigger sequences, and a fully documented exploitation path are, however, publicly available.
Patch Information
Eclipse Mosquitto fixed CVE-2026-110486 in 2.1.3, which the project calls a critical security release. The change is upstream commit 021b063, "Fix incorrect handling of websockets frames leading to potential RCE," written by maintainer Roger Light. It was authored on 2026-11-06 and committed on 2026-11-17. The GitHub advisory GHSA-6j8m-r32v-4h38 lists 2.1.0 through 2.1.2 as affected and 2.1.3 as patched. The maintainer's oss-security post recommends 2.1.4, because 2.1.3 introduced an unrelated regression in which legacy sha512 passwords were always rejected; 2.1.4 contains the same WebSocket fix plus the regression fix. The commit is small (68 additions, 9 deletions), touching lib/net_ws.c and lib/packet_mosq.c and adding a regression test.
Fix 1: a separate return value for MQTT bytes (lib/net_ws.c)
The patch adds a second variable, mqtt_len, that starts at -1 and is used only for application payload. len is still used for header parsing but can no longer leak out as the return value:
ssize_t net__read_ws(struct mosquitto *mosq, void *buf, size_t count) { ssize_t len = 0; + ssize_t mqtt_len = -1;
The payload read and unmasking loop now use mqtt_len:
mqtt_len = net__read(mosq, buf, count); if(mqtt_len > 0){ for(ssize_t i=0; i<mqtt_len; i++){ ((uint8_t *)buf)[i] ^= mosq->wsd.maskingkey[(i+mosq->wsd.pos)%4]; } mosq->wsd.pos += mqtt_len; }
The CLOSE, PONG, and PING/testing branches all set mqtt_len = -1 instead of len = -1, and the function ends with return mqtt_len;. The patch adds an explicit branch for the previously missed case:
+ }else if(mosq->wsd.payloadlen == 0){ + /* Empty frame */ + mqtt_len = -1; + errno = EAGAIN; }
An empty frame is now consumed and reported as "no application data yet" (-1 with EAGAIN), the same way control frames are handled, so the MQTT parser simply waits for more bytes.
Fix 2: a bounds check in the MQTT reader (lib/packet_mosq.c)
The patch adds a defensive check one layer up in packet__read_single(). If the transport ever reports reading more bytes than the packet still needs, the connection is rejected with a protocol error, which stops to_process (a uint32_t) from underflowing and pos from moving past the end of the buffer:
read_length = local__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process); if(read_length > 0){ + if((size_t)read_length > (size_t)mosq->in_packet.to_process){ + return MOSQ_ERR_PROTOCOL; + } metrics__int_inc(mosq_counter_bytes_received, read_length); mosq->in_packet.to_process -= (uint32_t)read_length;
Regression test
The commit adds test/broker/01-connect-websocket-empty-frame.py and registers it in CMake, the Makefile, and test.py. It only runs on builds with WITH_WEBSOCKETS and WITH_WEBSOCKETS_BUILTIN. The test starts a broker with a WebSocket listener and allow_anonymous=False, then sends a CONNECT packet missing its last four bytes, an empty binary frame, and the remaining four bytes. It passes only if the broker returns the expected CONNACK (return code 5, not authorized) and is still running, confirming that an empty frame no longer moves the MQTT packet position and exercising the pre-authentication path.
Scope
Only the built-in WebSocket reader (lib/net_ws.c) changes. Builds that use the libwebsockets backend take a different code path, as both the advisory and issue #3704 note. The ChangeLog and release notes describe the fix as correcting websocket frame handling that "could lead to out of bounds memory access and potential remote code execution."
Affected Systems and Versions
Eclipse Mosquitto versions 2.1.0 through 2.1.2 are affected, specifically when a listener is configured with protocol websockets using the built-in WebSocket implementation. Deployments compiled with the libwebsockets backend take a different code path and are not affected by this flaw. The issue is fixed in 2.1.3, but the project recommends 2.1.4 because of an unrelated sha512 password regression introduced in 2.1.3.
Vendor Security History
The project's security page records earlier vulnerabilities and fixes, including multiple 2023 memory-related issues affecting releases through 2.0.15 and fixed in 2.0.16. Separately, the Eclipse Foundation reported that an independent Trail of Bits audit found issues in the password implementation and the Dynamic Security plugin, and that all issues identified by that audit were fixed in source code. These records document a history of disclosed defects and remediation. They do not by themselves establish a comparative security rating.
References
- NVD: CVE-2026-110486
- CVE Record: CVE-2026-110486
- GitHub Advisory GHSA-6j8m-r32v-4h38
- Eclipse CVE assignment work item 399
- Eclipse vulnerability report work item 521
- oss-security post (openwall)
- Fix commit 021b063
- Commit API metadata
- Post-fix lib/net_ws.c
- Mosquitto 2.1.4, 2.0.23 release notice
- GitHub issue #3704 (public trigger reproducer)
- born0monday: Pwning Home Assistant Green
- DZONERZY: MASKerade, Phantom Bytes, Real Shell
- Corgea research writeup
- DZONERZY: Prompt and Pwn series
- Eclipse Mosquitto project site
- Eclipse Mosquitto security page
- Eclipse Mosquitto security audit blog
- oss-sec archive
- Rapid7 vulnerability database entry



