libmosquitto leaks uninitialized heap in CONNECT Will payloads (CVE-2026-130491)
Will payloads larger than 65535 bytes are not rejected, so uninitialized bytes go out in a malformed CONNECT packet.
Uninitialized heap disclosure in Eclipse libmosquitto Will
In the Eclipse Mosquitto client library libmosquitto, mosquitto_will_set() and mosquitto_will_set_v5() do not reject Will payloads longer than 65535 bytes. The library then sends up to 65535 bytes of uninitialized heap as the Will in CONNECT. Any application that passes an oversized Will leaks that memory to the MQTT recipient. Affected builds are 1.5 through 1.6.13, 2.0.0 through 2.0.22, and 2.1.0 through 2.1.2.
What to do: Pass Will payloads of at most 65535 bytes to mosquitto_will_set() and mosquitto_will_set_v5(). Eclipse has not listed a fixed release.
| Product | Affected |
|---|---|
| Eclipse Mosquitto libmosquitto | 1.5-1.6.13, 2.0.0-2.0.22, 2.1.0-2.1.2 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
In Eclipse versions 1.5-1.6.13, 2.0.0-2.0.22 and 2.1.0-2.1.2, the client library libmosquitto does not reject Will messages with payloads greater than 65535 bytes when calling `mosquitto_will_set()` or `mosquitto_will_set_v5()`. This results in up to 65535 bytes of uninitialised heap memory being transmitted as the Will. This can be mitigated by only passing payloads with a maximum length of 65535 bytes.
Will payloads larger than 65535 bytes are not rejected, so uninitialized bytes go out in a malformed CONNECT packet.
Today 2.4K readers · 2.6K views · 142 reads · all time 206K views