Summary
Eclipse Mosquitto 2.1 through 2.1.2 mishandles empty WebSocket frames on listeners configured with `protocol websockets`, which can lead to memory disclosure, heap corruption and a broker crash. The source assigns a CVSS 3.1 score of 9.8 (critical).
What happened
In Eclipse Mosquitto, a listener configured with `protocol websockets` mishandles WebSocket data frames with a zero-length payload. The WebSocket read function returns the number of framing bytes consumed without writing anything to the caller's buffer, and the MQTT packet reader treats that 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 that memory (information disclosure, including heap and libc pointers). It can also underflow an unsigned counter, so that subsequent attacker-controlled frame data is written past the end of the allocation (heap out-of-bounds write). According to the description, this write is reachable from the CONNECT packet before any authentication check. The associated CWEs are CWE-787, CWE-908 and CWE-191.
Why it matters
According to the source, an unauthenticated client can corrupt the heap and crash the broker even when `allow_anonymous false` is set. The description also states that combining the information disclosure with the out-of-bounds write allows remote code execution as the broker's user by any client able to establish a session. The CVSS 3.1 score is 9.8 (vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, source: CNA eclipse) and the severity is critical. Based on the available information, CISA's KEV catalog does not list this vulnerability as actively exploited.
Affected products and versions
Eclipse Mosquitto (Eclipse Foundation), versions >= 2.1 and <= 2.1.2 (introduced in 2.1; last affected version: 2.1.2). Affects listeners configured with `protocol websockets`.
| Product | Versions | Fixed in |
|---|---|---|
| Eclipse Foundation Eclipse Mosquitto | >= 2.1, <= 2.1.2 | — |
Action recommended by the source
The source does not state a fixed version or a specific mitigation. Readers are advised to consult the vendor advisories: https://github.com/eclipse-mosquitto/mosquitto/security/advisories/GHSA-6j8m-r32v-4h38 and https://gitlab.eclipse.org/security/vulnerability-reports/-/work_items/521.
Sources and references
- https://gitlab.eclipse.org/security/vulnerability-reports/-/work_items/521 — CVE Program
- https://github.com/eclipse-mosquitto/mosquitto/security/advisories/GHSA-6j8m-r32v-4h38 — CVE Program
- https://gitlab.eclipse.org/security/cve-assignment/-/work_items/399 — CVE Program
Weaknesses (CWE): CWE-787, CWE-908, CWE-191
Relevant change history
Published
Advisory published.