Eclipse Paho Go MQTT may incorrectly encode strings if length exceeds 65535 bytes
Published 2 Dec 2025 · Updated 10 Sept 2026
Is your project on an affected github.com/eclipse/paho.mqtt.golang?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.5.1
- Fixed in
- 1.5.1
go get github.com/eclipse/paho.mqtt.golang@v1.5.1Details
In Eclipse Paho Go MQTT v3.1 library (paho.mqtt.golang) versions <=1.5.0 UTF-8 encoded strings, passed into the library, may be incorrectly encoded if their length exceeds 65535 bytes. This may lead to unexpected content in packets sent to the server (for example, part of an MQTT topic may leak into the message body in a PUBLISH packet).
The issue arises because the length of the data passed in was converted from an int64/int32 (depending upon CPU) to an int16 without checks for overflows. The int16 length was then written, followed by the data (e.g. topic). This meant that when the data (e.g. topic) was over 65535 bytes then the amount of data written exceeds what the length field indicates. This could lead to a corrupt packet, or mean that the excess data leaks into another field (e.g. topic leaks into message body).
Is GHSA-32fw-gq77-f2f2 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/eclipse/paho.mqtt.golang, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2025-10543
- Linkgithub.com/eclipse-paho/paho.mqtt.golang/issues/730
- Linkgithub.com/eclipse-paho/paho.mqtt.golang/pull/714
- Linkgithub.com/alpinelinux/build-server-status/commit/e3487897db32c8c3d0287643f8384a6669e93731
- Advisorygithub.com/advisories/GHSA-32fw-gq77-f2f2
- Packagegithub.com/eclipse-paho/paho.mqtt.golang
- Linkgitlab.eclipse.org/security/vulnerability-reports/-/issues/254
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.