critical

CVE

CVE-2026-110486, CVE-2026-126708, CVE-2026-130491, CVE-2026-126763, CVE-2026-129705, CVE-2026-129149, CVE-2026-126706

CWE

CWE-787, CWE-191, CWE-252

Affected Surface

  • Eclipse Mosquitto broker 2.1.0, 2.1.1 and 2.1.2 with a `protocol websockets` listener using the built-in implementation (the CMake default, `WITH_WEBSOCKETS_BUILTIN=ON`)
  • Official `eclipse-mosquitto` Docker images for 2.1.0 through 2.1.2 when the mounted `mosquitto.conf` defines a websockets listener
  • Home Assistant Mosquitto broker add-on 7.1.1 and earlier
  • Mosquitto 2.0.0 through 2.0.22 and 2.1.0 through 2.1.2 linked against OpenSSL 4.0 with the FIPS provider (`CVE-2026-126708`)

TL;DR

Mosquitto is a widely used open-source MQTT broker. The official Docker image alone has about 697 million pulls. Version 2.1 added a built-in WebSocket implementation so the broker no longer needs libwebsockets for MQTT over WebSocket, and it’s the CMake default (WITH_WEBSOCKETS=ON, WITH_WEBSOCKETS_BUILTIN=ON).

That new code mishandles empty frames. When a client sends a masked WebSocket frame with no payload, net__read_ws() returns the number of header bytes it just consumed (4 for the masking key) as though they were MQTT data. The MQTT packet reader subtracts that from the bytes it still needs, the unsigned counter wraps to about 4 GiB, and the read position moves past the end of the heap buffer. The next frame’s bytes land out of bounds. All of this happens before the client has sent a valid CONNECT, so authentication never comes into play.

Eclipse fixed it on 17 November 2026 as CVE-2026-110486 (critical) in Mosquitto 2.1.3. It wasn’t a quiet bug. The root cause had been public since 10 August as GitHub issue #3704, which concluded there was no memory-safety impact. On 4 November born0monday published a full pre-auth RCE chain against the Home Assistant Mosquitto add-on, which they had built for Pwn2Own Ireland 2026. A second researcher, DZONERZY, published another chain to an interactive shell under the name MASKerade.

What to do now:

  1. Upgrade to Mosquitto 2.1.4. 2.1.3 has the fix but broke legacy SHA-512 password hashes, and 2.1.4 repairs that. The official Docker tags 2.1.4, 2.1-alpine, latest and openssl were rebuilt at 19:02 UTC on 17 November.
  2. If you can’t upgrade, remove protocol websockets listeners from mosquitto.conf, or rebuild with -DWITH_WEBSOCKETS_BUILTIN=OFF to use libwebsockets instead.
  3. Home Assistant users: update the Mosquitto broker add-on to 7.1.2 or later.
  4. Brokers on 2.0.x are not affected by the WebSocket bug, but upgrade them to 2.0.23 for the other fixes in this release.

Affected packages and projects

EcosystemPackageAffected versionsFixed or safe version
C / source, OS packagesEclipse Mosquitto broker (CVE-2026-110486)2.1.0 to 2.1.2 with a built-in websockets listener2.1.3 (use 2.1.4)
Docker Hubeclipse-mosquitto (CVE-2026-110486)2.1.0 to 2.1.2 tags (and 2.1, latest before 17 November) when the config defines a websockets listener2.1.4, 2.1.4-alpine, 2.1-alpine, latest
Home Assistant add-onMosquitto broker7.1.1 and earlier7.1.2 (19 October 2026)
C / source, OS packagesEclipse Mosquitto (CVE-2026-126708, high)2.0.0 to 2.0.22, 2.1.0 to 2.1.2, only with OpenSSL 4.0 and the FIPS provider2.0.23, 2.1.3
C / source, OS packagesEclipse Mosquitto (CVE-2026-130491, medium)1.5 to 1.6.13, 2.0 to 2.0.22, 2.1.0 to 2.1.22.0.23, 2.1.3

The 17 November release also fixes CVE-2026-126763 (all delayed wills suppressed by one will-delay value, low), CVE-2026-129705 (PROXY v2 AF_UNIX TLV injection bypasses TLS and certificate policy, low, 2.1 only), and two mosquitto_ctrl crashes when connecting to a malicious broker (CVE-2026-129149, CVE-2026-126706, medium).

Mosquitto’s own GitHub advisories carry no CVSS score, and neither NVD nor FIRST EPSS had a record for CVE-2026-110486 when we checked on 17 November.

Technical analysis

1. Two layers, one counter

For WebSocket connections, the MQTT packet reader calls net__read_ws() through a function pointer as if it were read(). Once it has the fixed header and Remaining Length, it allocates a body buffer of exactly that size and loops until the body is full (lib/packet_mosq.c, 2.1.2):

while(mosq->in_packet.to_process>0){
    read_length = local__read(mosq, &(mosq->in_packet.payload[mosq->in_packet.pos]), mosq->in_packet.to_process);
    if(read_length > 0){
        metrics__int_inc(mosq_counter_bytes_received, read_length);
        mosq->in_packet.to_process -= (uint32_t)read_length;
        mosq->in_packet.pos += (uint32_t)read_length;
  • to_process is a uint32_t holding the body bytes still needed.
  • The loop trusts read_length <= to_process, which holds for a real read() with count = to_process.
  • Nothing checks pos against the buffer size. If to_process wraps, pos keeps growing and payload[pos] points past the allocation.

2. Where net__read_ws() breaks that assumption

net__read_ws() parses the WebSocket frame header in steps. Each step stores its byte count in the same len variable that the function returns (lib/net_ws.c, 2.1.2, trimmed):

ssize_t net__read_ws(struct mosquitto *mosq, void *buf, size_t count)
{
    ssize_t len = 0;

    if(mosq->wsd.payloadlen == 0){
        if(mosq->wsd.opcode == UINT8_MAX){
            len = read_ws_opcode(mosq);
            ...
        if(mosq->wsd.mask == UINT8_MAX){
            len = read_ws_payloadlen_short(mosq);
            ...
        if(mosq->wsd.mask == 1 && mosq->wsd.mask_bytes > 0){
            len = read_ws_mask(mosq);
            ...
    }
    ...
    if(mosq->wsd.payloadlen > 0){
        ...
        len = net__read(mosq, buf, count);
        ...
    }
    ...
    return len;
}
  • For a frame with data, the last assignment is len = net__read(mosq, buf, count), which is capped at count, so the header byte counts are overwritten and nothing goes wrong.
  • For an empty frame, payloadlen is 0, so that read is skipped. The function falls through and returns whatever the last header step returned: 4 after reading a masking key, or 1 after reading the short length byte.
  • None of those header bytes were written to buf, and neither number is bounded by count.

Back in the caller, suppose to_process is 3. An empty masked frame returns 4, to_process becomes (uint32_t)-1 (about 4 GiB), and pos moves one byte past the end of the body buffer. The loop is still running, and the next data frame is copied straight to payload[pos]. born0monday uses the 1-byte path to set to_process to whatever remainder they need first. DZONERZY’s trigger needs three frames:

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
  • \x10\x01 is an MQTT CONNECT header with a one-byte body, so the broker allocates a one-byte buffer and waits.
  • The empty masked frame makes net__read_ws() return 4. to_process wraps, and pos is now 4.
  • The 256 bytes in the third frame are written at offset 4 of a one-byte allocation.

The in_packet state survives between event-loop iterations, so an attacker can keep writing out of bounds across frames and leave gaps with more empty frames. That gives a relative heap write primitive.

3. From heap write to code execution

Both researchers built full chains. born0monday’s targets the Home Assistant Green (aarch64) add-on container on TCP 1884. They spray PINGREQ packets so the broker queues PINGRESP packets of a known chunk size, open the overflowing packet in the same size class, and overwrite a queued response’s to_process field. The send loop doesn’t check pos against the payload either, so the broker then writes kilobytes of adjacent heap back to the client. That leak defeats ASLR. A second connection then has its payload pointer corrupted by the first, which turns the relative write into an arbitrary one. The final step overwrites the strncmp GOT entry with system, so the next PUBLISH topic the broker compares runs as a shell command. The broker doesn’t crash along the way. DZONERZY reports a shell on a default-deny configuration against a PIE binary with NX, full RELRO and glibc safe-linking.

4. The fix (021b063, 17 November 2026)

The patch separates “bytes of MQTT data copied” from header bookkeeping, treats an empty frame as “no data yet”, and adds a bounds check in the generic reader:

 ssize_t net__read_ws(struct mosquitto *mosq, void *buf, size_t count)
 {
 	ssize_t len = 0;
+	ssize_t mqtt_len = -1;
 ...
-		len = net__read(mosq, buf, count);
-		if(len > 0){
-			for(ssize_t i=0; i<len; i++){
+		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 += len;
+			mosq->wsd.pos += mqtt_len;
 ...
+		}else if(mosq->wsd.payloadlen == 0){
+			/* Empty frame */
+			mqtt_len = -1;
+			errno = EAGAIN;
 		}
 ...
-	return len;
+	return mqtt_len;
 	while(mosq->in_packet.to_process>0){
 		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;
+			}
  • mqtt_len starts at -1 and is only set to a positive value by the actual payload read, so header byte counts can’t leak out as a return value.
  • An empty data frame now returns -1 with EAGAIN, which the caller already treats as “nothing to read yet”.
  • The new check in packet__read_single() turns any future transport that over-reports into a protocol error and disconnects, instead of wrapping to_process.
  • The commit adds test/broker/01-connect-websocket-empty-frame.py, which sends a CONNECT split around an empty frame and expects a normal CONNACK.

5. CVE-2026-126708: any password under OpenSSL 4.0 FIPS

Mosquitto did not check the return value of a password hashing call. According to the advisory, the only documented case is OpenSSL 4.0 with the FIPS provider and passwords shorter than 8 characters. There the hash function fails, the failure goes unnoticed, and the password is accepted. It affects 2.0.0 to 2.0.22 and 2.1.0 to 2.1.2. If you run FIPS builds against OpenSSL 4.0, treat this as an authentication bypass.

IOCs

No exploitation in the wild has been reported, and the advisory lists no indicators. Hunt for the technique:

  • WebSocket connections to the MQTT-over-WebSocket port (commonly 1884, 8080, 8081 or 9001) that send zero-length binary or continuation frames before CONNECT finishes. Legitimate MQTT clients don’t do this.
  • Many PINGREQ packets from an unauthenticated WebSocket session, which is how born0monday’s chain grooms the heap.
  • Mosquitto crashes or restarts with SIGSEGV or glibc heap errors (malloc(): corrupted top size, free(): invalid pointer) in the broker log, journalctl -u mosquitto, or docker logs.
  • Child processes of mosquitto, or outbound connections from the broker’s user or container.

Detection and remediation

Find the version and whether a websockets listener is configured:

mosquitto -h 2>&1 | head -1                       # prints "mosquitto version 2.1.x"
grep -nE '^\s*(listener|protocol)\b' /etc/mosquitto/mosquitto.conf /etc/mosquitto/conf.d/*.conf

# Containers
docker ps --format '{{.Image}} {{.Names}}' | grep -i mosquitto
docker exec <container> mosquitto -h 2>&1 | head -1
docker exec <container> grep -nE '^\s*(listener|protocol)' /mosquitto/config/mosquitto.conf

# Kubernetes
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' | grep -i mosquitto

A 2.1.0, 2.1.1 or 2.1.2 broker with a protocol websockets line is exposed. A broker built with -DWITH_WEBSOCKETS_BUILTIN=OFF uses libwebsockets and isn’t affected by this bug.

Check your pinned images and manifests:

grep -rnE 'eclipse-mosquitto:(2\.1(\.[0-2])?(-alpine|-openssl)?|latest)\b' \
  --include='*.yml' --include='*.yaml' --include='Dockerfile*' --include='*.tf' .

Mitigate before you can upgrade by commenting out the websockets listener:

# listener 9001
# protocol websockets

or by blocking the WebSocket port at the firewall for anything outside the networks that need it.

After upgrading to 2.1.4, also:

  1. Restart the broker and confirm mosquitto -h reports 2.1.4.
  2. If the WebSocket port was reachable from untrusted networks, check the host or container for files and processes you don’t recognize, and rotate what the broker could read: the password file, TLS private keys in certfile/keyfile, dynamic security plugin credentials, and bridge credentials to other brokers.
  3. If you use OpenSSL 4.0 with FIPS, reset any account with a password shorter than 8 characters and review broker logs for successful logins that shouldn’t have worked.

Timeline

  • 2026-08-04: born0monday finds the bug by fuzzing the Home Assistant Green’s Mosquitto add-on.
  • 2026-08-10: The same root cause is filed publicly as issue #3704, which treats it as a framing bug with no memory-safety impact. It is still open on 17 November.
  • 2026-08-20: born0monday reports the pre-auth RCE impact to the Eclipse Foundation security tracker.
  • 2026-10-19: Home Assistant ships the Mosquitto add-on 7.1.2 with a fix.
  • 2026-10-28: Eclipse closes born0monday’s report as a duplicate, without a fix date.
  • 2026-11-04: born0monday publishes the full exploit write-up.
  • 2026-11-17 01:18 UTC: Fix commit 021b063 lands.
  • 2026-11-17: The Mosquitto blog announces 2.1.3, 2.1.4 and 2.0.23.
  • 2026-11-17 16:58 to 16:59 UTC: Seven GitHub advisories are published, and Roger Light posts the CVEs to oss-security.
  • 2026-11-17 19:02 UTC: Official Docker images are rebuilt with 2.1.4 and 2.0.23.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Use AI-native static analysis to find similar application vulnerabilities and generate review-ready fixes.

References