Security Advisory

CVE-2023-28366: Mosquitto QoS 2 Memory Leak

Last updated:
  • CVE-2023-28366

CVE-2023-28366 is a memory leak (CWE-401) in the Eclipse Mosquitto MQTT broker 1.3.2 through 2.0.15: a remote client that sends many QoS 2 messages with duplicate message IDs and never answers PUBREC makes the broker hold memory until it runs out. NVD scores it 7.5. Update to Mosquitto 2.0.16 or a patched package.

Vulnerability summary

CVSS base score

7.5

High severity

EPSS score (FIRST)

1.3%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2023-28366 · Source: NVD

Affected components

ComponentCPEVersion range
Eclipse Mosquitto brokercpe:2.3:a:eclipse:mosquitto:*:*:*:*:*:*:*:*1.3.2 up to (excluding) 2.0.16 (NVD); fixed in 2.0.16 (Mosquitto security page)
Debian mosquitto packagepkg:deb/debian/mosquittoFixed in 2.0.11-1+deb11u1 (bullseye) and 2.0.11-1.2+deb12u1 (bookworm) via DSA-5511-1; buster ignored (Debian security tracker)
OpenWrt packages feed: mosquitto—openwrt-21.02 branch carries 2.0.15 (affected); openwrt-22.03 and openwrt-23.05 bumped to 2.0.17 on 2023-08-23 (OpenWrt packages repository, as of 2026-11-19)

What does this mean for affected devices?

Eclipse Mosquitto's security page describes CVE-2023-28366 in one line: "Clients sending unacknowledged QoS 2 messages with duplicate message ids cause a memory leak. Affecting versions 1.3.2 to 2.0.15 inclusive, fixed in 2.0.16." NVD adds the root cause: the broker mishandles EAGAIN from the libc send function. NVD's Primary score is CVSS v3.1 7.5, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, with CWE-401 (missing release of memory after effective lifetime). MITRE, the CNA, published the record on 2023-09-01 without a score; CISA's ADP entry on the CVE record uses the same 7.5 vector (NVD, CVE record).

How does the memory leak work?

Compass Security found it and published CSNC-2023-001 on 2023-08-31. The broker "does not properly handle error codes generated by the libc send() function. If an EAGAIN error code is returned the control flow will catch the error but return a success to the calling function. This skips the process of freeing the memory." A client sends many QoS 2 PUBLISH packets with the same message ID and never answers the broker's PUBREC, so unsent packets pile up until memory runs out. No authentication is part of NVD's vector, so any client that can reach the listener can try it. On a gateway, edge box or SCADA host where the broker is the MQTT or Sparkplug B hub, an out-of-memory broker stops telemetry and commands for every connected device.

Which Mosquitto versions are affected?

NVD's CPE configuration covers the Mosquitto broker from 1.3.2 up to, but excluding, 2.0.16. Compass Security tested 1.4 to 2.0.15 as vulnerable. The fix is commit 6113eac, released in Mosquitto 2.0.16 on 2023-08-16, which also fixed CVE-2023-0809 and CVE-2023-3592. Embedded Linux builds usually ship the broker as a distribution or build-system package, so check the package version:

  • Debian fixed it in 2.0.11-1+deb11u1 (bullseye) and 2.0.11-1.2+deb12u1 (bookworm) through DSA-5511-1; buster is marked ignored as a "minor memory leak which requires rewrite of core functions" (Debian security tracker). The tracker also lists two regression-fix commits that followed the original patch.
  • The OpenWrt packages feed bumped mosquitto to 2.0.17 on 2023-08-23 in the openwrt-22.03 and openwrt-23.05 branches; the openwrt-21.02 branch still carries 2.0.15 as of 2026-11-19 (OpenWrt packages).

No vendor PSIRT, CERT@VDE or CISA ICS advisory that names a device product for this CVE was found as of 2026-11-19, so identify exposure from the firmware's component list or SBOM.

How do you fix CVE-2023-28366?

Update the broker to Mosquitto 2.0.16 or later, or to the patched distribution package. Later Mosquitto releases also fix CVE-2024-8376, a broker use-after-free, CVE-2024-3935 in bridges and CVE-2024-10525 in the client library, so moving to a current 2.0.x release covers all of them. Until a device can be updated, keep the broker off untrusted networks, require authentication and TLS on every listener, and limit which hosts can connect. Our MQTT protocol security guide covers listener hardening, and the Sparkplug B security guide explains why the broker is a single point of failure in Sparkplug deployments.

Is CVE-2023-28366 exploited?

It is not in the CISA KEV catalog as of 2026-11-19 (catalog version 2026.11.18, 1,786 entries). CISA's SSVC entry records exploitation as "none" and automatable as "yes". FIRST EPSS gives it 0.0131, the 71.2nd percentile, in the 2026-11-18 dataset (CISA KEV, FIRST EPSS).

How to fix this class of issueNo dedicated SoftWSP guide covers this weakness class; the fix is usually the vendor patch or firmware update referenced above. Our related guide explains how to plan and verify it: NIST SP 800-40 Rev. 4: enterprise patch management planning, explained.

Evidence

  • NVD: broker in Eclipse Mosquitto 1.3.2 through 2.x before 2.0.16 has a remotely abusable memory leak with many QoS 2 messages with duplicate message IDs and no PUBREC response, caused by mishandling EAGAIN from libc send; NVD Primary CVSS v3.1 7.5 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H; CWE-401; CPE eclipse:mosquitto 1.3.2 to before 2.0.16; published 2023-09-01. — NVD
  • CVE.org: state PUBLISHED, CNA MITRE, published 2023-09-01, no CNA score; CISA-ADP CVSS 3.1 7.5 same vector; SSVC exploitation none, automatable yes, technical impact partial. — CVE.org
  • Mosquitto security page: August 2023, CVE-2023-28366, clients sending unacknowledged QoS 2 messages with duplicate message ids cause a memory leak; affecting 1.3.2 to 2.0.15 inclusive, fixed in 2.0.16. — Eclipse Mosquitto
  • Mosquitto 2.0.16 released 2023-08-16 as a security and bugfix release fixing CVE-2023-28366, CVE-2023-0809 and CVE-2023-3592. — Eclipse Mosquitto
  • Compass Security CSNC-2023-001 (2023-08-31): broker does not handle EAGAIN from send(), returns success and skips freeing memory; vulnerable v1.4 - v2.0.15; upgrade to 2.0.16; discovered 2023-03-06, vendor notified 2023-03-20. — Compass Security
  • Debian: fixed in bullseye 2.0.11-1+deb11u1 and bookworm 2.0.11-1.2+deb12u1 (DSA-5511-1); buster ignored as minor memory leak requiring rewrite of core functions; fix commit 6113eac plus two regression-fix commits. — Debian security tracker
  • OpenWrt packages: net/mosquitto bumped to 2.0.17 on 2023-08-23 in openwrt-22.03 and openwrt-23.05; openwrt-21.02 Makefile carries PKG_VERSION 2.0.15 (read 2026-11-19). — OpenWrt packages
  • Not in CISA KEV catalog version 2026.11.18; EPSS 0.0131, percentile 0.71239, dataset 2026-11-18. — CISA KEV / FIRST EPSS

Related advisories

Sources

  1. NVD
  2. Eclipse Mosquitto security page: past vulnerabilities
  3. Eclipse Mosquitto: Version 2.0.16 released (2023-08-16)
  4. Mosquitto fix commit 6113eac
  5. Compass Security advisory CSNC-2023-001: Eclipse Mosquitto memory leak
  6. Debian security tracker: CVE-2023-28366
  7. OpenWrt packages: net/mosquitto Makefile (openwrt-21.02)
  8. CVE.org record CVE-2023-28366 (CNA: MITRE)
  9. CISA KEV
  10. FIRST EPSS

Frequently asked questions

Which Mosquitto version fixes CVE-2023-28366?

Mosquitto 2.0.16, released on 2023-08-16; versions 1.3.2 to 2.0.15 are affected. Debian ships the fix as 2.0.11-1+deb11u1 for bullseye and 2.0.11-1.2+deb12u1 for bookworm (per the Mosquitto security page and the Debian security tracker).

Can CVE-2023-28366 be triggered without credentials?

NVD's vector has no privileges required: a client that can connect sends many QoS 2 messages with duplicate message IDs and ignores PUBREC, and the leaked memory builds up into a denial of service. Requiring authentication on every listener narrows who can try it (per NVD and Compass Security CSNC-2023-001).

Is the Mosquitto package in OpenWrt affected by CVE-2023-28366?

The openwrt-22.03 and openwrt-23.05 package branches moved to Mosquitto 2.0.17 on 2023-08-23, which includes the fix. The openwrt-21.02 branch still lists 2.0.15 as of 2026-11-19, which is in the affected range (per the OpenWrt packages repository).

Is CVE-2023-28366 exploited in the wild?

It is not in the CISA KEV catalog as of 2026-11-19 (catalog version 2026.11.18). FIRST EPSS gives it 0.0131, the 71.2nd percentile, in the 2026-11-18 dataset (per CISA KEV and FIRST EPSS).