Eclipse Mosquitto Empty WebSocket Frame Parser Desync (CVE-2026-110486)
Published: 2026-11-25 • Researcher: googlesky / Lê Hiếu (PoC and laboratory); Eclipse Mosquitto project (advisory GHSA-6j8m-r32v-4h38)
- Severity
- Critical
- CVE
- CVE-2026-110486 (GHSA-6j8m-r32v-4h38)
- Category
- network
- Affected product
- Eclipse Mosquitto MQTT broker — builtin WebSocket support (lib/net_ws.c, lib/packet_mosq.c)
- Affected versions
- Eclipse Mosquitto 2.1 through 2.1.2; fixed in 2.1.3 (vendor commit 021b063df9e68608a5d58d95031b0073a39d2c90)
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-110486
- https://github.com/eclipse-mosquitto/mosquitto/security/advisories/GHSA-6j8m-r32v-4h38
- https://github.com/eclipse-mosquitto/mosquitto/commit/021b063df9e68608a5d58d95031b0073a39d2c90
- https://github.com/eclipse-mosquitto/mosquitto/releases/tag/v2.1.3
- https://gitlab.eclipse.org/security/cve-assignment/-/work_items/399
- https://gitlab.eclipse.org/security/vulnerability-reports/-/work_items/521
- http://www.openwall.com/lists/oss-security/2026/11/17/14
- https://github.com/googlesky/CVE-2026-110486
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-11-19 |
| Author / Researcher | googlesky / Lê Hiếu (PoC and laboratory); Eclipse Mosquitto project (advisory GHSA-6j8m-r32v-4h38) |
| CVE / Advisory | CVE-2026-110486 (GHSA-6j8m-r32v-4h38) |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| Status | PoC |
| Tags | MQTT, Mosquitto, WebSocket, unauthenticated, memory-corruption, uninitialised-memory, out-of-bounds-write, CWE-908, broker |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Eclipse Mosquitto MQTT broker — builtin WebSocket support (lib/net_ws.c, lib/packet_mosq.c) |
| Versions Affected | Eclipse Mosquitto 2.1 through 2.1.2; fixed in 2.1.3 (vendor commit 021b063df9e68608a5d58d95031b0073a39d2c90) |
| Language / Platform | C; Linux/Unix broker; a listener configured with protocol websockets built against WITH_WEBSOCKETS_BUILTIN=ON |
| Authentication Required | No — the trigger is reachable from the CONNECT packet before any authentication check, including with allow_anonymous false |
| Network Access Required | Yes — a TCP WebSocket connection to the broker’s websockets listener |
Summary
Eclipse Mosquitto 2.1 through 2.1.2 mishandles empty WebSocket data frames on listeners configured with the websockets protocol. The builtin WebSocket frame reader consumes the four masking-key bytes of a zero-length frame and reports them to the MQTT parser as four bytes of application data, without ever writing those bytes to the caller buffer. The MQTT packet reader trusts that count, so the broker advances over uninitialised heap memory while handling the first packet, before authentication, which discloses heap and libc pointers and with a suitable heap layout can underflow the unsigned to-process counter and write past the payload allocation. The result is information disclosure, a remotely triggerable broker crash, and potential remote code execution as the broker user.
Vulnerability Details
Root Cause
net__read_ws() in lib/net_ws.c conflates two different quantities: the number of bytes consumed from the socket (WebSocket framing header plus the four-byte masking key) and the number of payload bytes delivered to the caller. For a data frame with a zero-length payload, the function reads and consumes the masking key, so its local len becomes 4, but it skips the net__read() call and never writes anything into the caller’s buffer. The data-frame branch also leaves len untouched because, unlike control frames, data frames have no out_packet bookkeeping that resets it. packet__read_single() in lib/packet_mosq.c then interprets the returned 4 as four bytes of MQTT packet data. For an empty frame the two values differ by exactly four, so parser state advances over memory the broker never filled. The vendor fix in 2.1.3 introduces a separate mqtt_len value, initialised to -1, and returns -1/EAGAIN for an empty frame after reading the mask.
Attack Vector
Any remote client that can open a WebSocket to a listener configured with protocol websockets performs the standard HTTP Upgrade (GET /mqtt, Sec-WebSocket-Protocol: mqtt) and then sends a single masked data frame with payload length 0 (opcode 0x2, FIN set). No MQTT credentials and no prior packets are required — the desync happens while the broker is still waiting for the first CONNECT packet. In the laboratory the broker zeroes the packet buffer during the handshake, so the phantom read deterministically yields four zero bytes and the vulnerable broker logs First packet not CONNECT (00); with attacker-shaped heap state the same primitive feeds uninitialised heap bytes into CONNECT parsing.
Impact
- Information disclosure: uninitialised heap memory, including heap and libc pointers, is processed and can be forwarded by the broker.
- Denial of service: the unsigned
to_processcounter can underflow, after which subsequent attacker-controlled frame data is written past the end of the allocation; heap corruption crashes the broker even when anonymous access is disabled. - Potential code execution: the advisory describes combining the disclosure and the out-of-bounds write to execute code as the broker’s user from any client able to establish a session.
This archived PoC demonstrates the deterministic root cause — the pre-authentication four-byte phantom read and parser desync — and the differential against the fixed 2.1.3 build; it does not include a heap-groomed out-of-bounds-write or RCE chain (see Notes).
Environment / Lab Setup
OS: Linux x86_64 (host running Podman or Docker)
Target: mosquitto v2.1.2 built from upstream source with ASan+UBSan
(image cve-2026-110486:vuln, Debian trixie-slim runtime)
ws listener :8080, mqtt listener :1883, supervisor :8081
Fix control: mosquitto v2.1.3, same flags/config/supervisor (cve-2026-110486:fixed)
Attacker: Python 3.12 stdlib-only driver (image cve-2026-110486-poc:local)
Tools: podman (or docker), python3, cmake/build-essential in the build stageSetup Steps
| |
Notes from the upstream lab: ASAN_OPTIONS=detect_leaks=0 is set by the supervisor because LeakSanitizer is incompatible with its process handling, and the build target is build/src/mosquitto rather than build/mosquitto.
Proof of Concept
Step-by-Step Reproduction
Build and start the lab —
./run-lab.sh build && ./run-lab.sh upproducesmosq-vuln(2.1.2) andmosq-fixed(2.1.3) on thecve110486labnetwork.Open the WebSocket — the PoC sends an HTTP Upgrade to port 8080 with
Upgrade: websocket,Sec-WebSocket-Version: 13andSec-WebSocket-Protocol: mqtt, and checks for a101response (handshake()inpoc/poc.py).Send the empty data frame — a single masked binary frame (opcode 0x2, FIN) with a zero-length payload is written to the socket. The four masking-key bytes are consumed by
net__read_ws()but no payload byte is delivered.Read the broker verdict — the driver restarts the broker and queries the supervisor’s
GET /statuson port 8081, which returns the broker exit state, sanitizer flag and the last 4000 bytes of broker log.Check the marker — the vulnerable build logs
Protocol error from <ip>:<port>: First packet not CONNECT (00).followed by a protocol-error disconnect. The fixed build ignores the empty frame and keeps the session alive until the client closes.
| |
Against the fixed side use --host=mosq-fixed; the empty frame then produces no phantom command.
Exploit Code
See
poc/poc.pyfor the check/exploit/probe/mitigation driver andexploit/exploit.pyfor the standalone script. Both build the zero-length frame with the same helper.
| |
The server-side bug, for context (v2.1.2 lib/net_ws.c, approximate line numbers from the upstream write-up):
| |
Expected Output
| |
Fixed build, same request:
| |
Probe matrix on the vulnerable build:
| |
Screenshots / Evidence
evidence/check-vuln-run.txt— vulnerable 2.1.2 loggingFirst packet not CONNECT (00)after one empty data frameevidence/check-fixed-run.txt— 2.1.3 ignoring the same frameevidence/exploit-standalone-run.txt— standalone script confirming the desyncevidence/probe-vuln-run.txt— empty/ping/data control matrixevidence/versions.txt— build and lab preconditions
Detection & Indicators of Compromise
Broker log (the deterministic signal used by this PoC):
| |
Other indicators:
- A WebSocket Upgrade to the MQTT endpoint (
Sec-WebSocket-Protocol: mqtt) immediately followed by a masked binary frame with payload length 0, then a protocol-error disconnect or a broker crash. - ASan/UBSan output in the broker’s stderr: heap-use-of-uninitialised values or heap-buffer-overflow in
packet__read_single()/net__read_ws(), followed by a broker restart. - Unexplained broker restarts or crashes on hosts that expose a websockets listener, especially repeated from the same source address.
- If the downstream disclosure is attempted, broker traffic carrying bytes that were never sent by any client (uninitialised heap contents) toward a subscribed client.
IDS rule (illustrative shape — tune to your sensor):
| |
The byte pattern above only matches an unmasked-looking header; because clients mask frames, confirm with broker logs or MQTT-aware parsing rather than relying on the payload bytes alone.
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade Eclipse Mosquitto to 2.1.3 or later, which contains the vendor fix (commit 021b063df9e68608a5d58d95031b0073a39d2c90); the fix returns -1/EAGAIN for an empty frame after reading the mask instead of reporting four payload bytes. |
| Workaround | If upgrading is not immediately possible, disable the builtin WebSocket support (WITH_WEBSOCKETS_BUILTIN=OFF) or remove/restrict protocol websockets listeners to trusted networks; terminate WebSockets in a separate proxy. Note that allow_anonymous false does not prevent the trigger, because the desync occurs before the CONNECT packet is authenticated. |
| Config Hardening | Bind WebSocket listeners to a management interface or UNIX socket behind an authenticating reverse proxy, run the broker as an unprivileged dedicated user, apply container/namespace isolation, cap connections per source, monitor broker logs for protocol errors and worker restarts, and keep ASan/UBSan builds in test environments to catch similar regressions. |
References
Notes
Auto-ingested from https://github.com/googlesky/CVE-2026-110486 on 2026-11-25. Review verdict: this is a real PoC, not a detector — it drives a genuine ASan+UBSan build of the broker over its WebSocket listener, sends the crafted zero-length frame, and proves the pre-authentication parser desync with a differential against the vendor-fixed 2.1.3 build (controls for ping and normal data frames included). Status is PoC rather than Weaponized because the scripts stop at the deterministic primitive: the README explicitly states that the downstream heap out-of-bounds write and RCE depend on attacker-shaped heap state (uninitialised bytes forming a larger MQTT remaining length plus a follow-up frame), and no such heap-grooming chain is shipped. The runner requires the lab supervisor’s GET /status and POST /restart endpoint on port 8081, so the scripts are tied to this laboratory rather than working against an arbitrary broker; only the frame construction and handshake would carry over to a third-party target.
License: MIT (Copyright (c) 2026 Lê Hiếu). The upstream LICENSE and CITATION files were not copied because the entry is limited to exploit-relevant source/config files; attribution is preserved here and in upstream-README.md. Every source and config file needed to rebuild the trigger was copied; the excluded upstream working record (TRACKING.md) and the evidence/ runs not copied are redundant. CVEs/CWEs: NVD lists CWE-191 (integer underflow), CWE-787 (out-of-bounds write) and CWE-908 (use of uninitialised resource), while the upstream README labels the issue CWE-125/CWE-787 — the discrepancy is in the public records, not in the PoC. CVSS 9.8 with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H was confirmed against the NVD 2.0 API record. No exploit code was executed during ingestion. Run only against brokers you own or are explicitly authorized to test.
| |