
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-59947 is a heap buffer overflow vulnerability in NanoMQ, a lightweight MQTT messaging broker/bus designed for IoT Edge and Software-Defined Vehicle (SDV) environments. The flaw affects all NanoMQ versions prior to 0.24.4 and is triggered when MQTT PUBLISH packets simultaneously activate both shared subscriptions and vanilla (regular) subscriptions. It was reported on September 2, 2025, and publicly disclosed on December 15, 2025, with a fix released in version 0.24.4. The vulnerability carries a CVSS v3.1 score of 9.0 (Critical) and a CVSS v4.0 score of 8.5 (High) (GitHub Advisory, Red Hat CVE).
The root cause is a classic buffer copy without size checking (CWE-120), located in the foreach_client function within nanomq/pub_handler.c. Specifically, the cvector_grow call incorrectly grew the msg_infos vector to ctx_list_len instead of ctx_list_len + cvector_size(msg_infos), causing a heap buffer overflow when both shared and vanilla subscriptions were active for the same topic. AddressSanitizer output from the bug report confirms a WRITE of 4 bytes past the end of a 24-byte heap region during a memcpy in foreach_client at pub_handler.c:127. The fix, committed as 5f5581054bb92f102cf99251e8af2f43763d457b, corrects the growth calculation to account for the existing vector size (GitHub Issue, GitHub Commit).
Successful exploitation can result in high-impact integrity and availability compromise of the NanoMQ broker, including potential denial of service via crash or memory corruption, and possible arbitrary code execution. The vulnerability also carries a high confidentiality impact on subsequent systems, as a compromised broker could expose all MQTT messages transiting through it — a significant risk in IoT and SDV environments where sensitive telemetry or control data may be in transit. The changed scope in the CVSS v3.1 rating indicates that exploitation can affect systems beyond the vulnerable broker itself (GitHub Advisory).
No public proof-of-concept exploit code has been released; the reporter (roman-kraus-fokus) indicated a PoC exists but chose to share it privately with the vendor to avoid endangering NanoMQ deployments. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.04%, reflecting low near-term exploitation probability. Exploitation requires low privileges (an authenticated MQTT client) and passive user interaction, limiting but not eliminating risk for exposed deployments (GitHub Issue, Red Hat CVE).
mosquitto_pub/mosquitto_sub or a custom MQTT client library).$share/group/test/topic) and a regular vanilla subscription (e.g., test/topic) from one or more clients, ensuring both subscription types are active simultaneously.test/topic) that matches both the shared and vanilla subscriptions. The foreach_client function in pub_handler.c will attempt to grow the msg_infos vector with an incorrect size, causing a heap buffer overflow.pub_handler.c or foreach_client; AddressSanitizer output showing heap-buffer-overflow at pub_handler.c:127 if compiled with ASan.nanomq process; abnormal memory usage spikes in the broker process preceding a crash.$share/group/...) and regular subscriptions active simultaneously, especially from low-privilege clients; repeated connection/disconnection cycles from the same client following broker crashes.Upgrade NanoMQ to version 0.24.4 or later, which contains the fix for this vulnerability. As an interim workaround for deployments that cannot immediately upgrade, disable shared subscription functionality in the NanoMQ configuration to prevent the vulnerable code path from being triggered. Additionally, restrict network access to NanoMQ instances to only trusted clients and minimize the number of low-privilege accounts that can publish to topics with mixed subscription types (GitHub Advisory, Red Hat CVE).
The vulnerability was reported by researcher roman-kraus-fokus from FOKUS Fraunhofer Institute and disclosed via GitHub's security advisory process. The reporter noted a PoC was available but withheld from public release to protect NanoMQ users. The advisory was published by NanoMQ maintainer JaylinYu on December 14–15, 2025. Coverage has been limited to automated vulnerability tracking platforms (Vulners, VulDB, INCIBE-CERT) and a brief mention on Bluesky's CVE tracking account, with no significant broader media or researcher commentary observed (GitHub Advisory, GitHub Issue).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."