CVE-2023-33658
📋 TL;DR
A heap buffer overflow vulnerability in NanoMQ 0.17.2 allows attackers to trigger denial of service by exploiting the nni_msg_get_pub_pid() function. This affects systems running vulnerable versions of NanoMQ message broker software. The vulnerability could potentially lead to service crashes or instability.
💻 Affected Systems
- NanoMQ
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete service disruption through denial of service, potentially allowing remote code execution if heap manipulation succeeds
Likely Case
Service crash and denial of service affecting message broker functionality
If Mitigated
Limited impact with proper network segmentation and monitoring
🎯 Exploit Status
Exploitation requires triggering the vulnerable function, which may be accessible via network messages
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in commit 657e6c81c474bdee0e6413483b990e90610030c1
Vendor Advisory: https://github.com/emqx/nanomq/issues/1153
Restart Required: Yes
Instructions:
1. Update NanoMQ to latest version or apply commit 657e6c81c474bdee0e6413483b990e90610030c1
2. Recompile from source if using custom build
3. Restart NanoMQ service
🔧 Temporary Workarounds
Network segmentation
linuxRestrict access to NanoMQ service to trusted networks only
iptables -A INPUT -p tcp --dport 1883 -s trusted_network -j ACCEPT
iptables -A INPUT -p tcp --dport 1883 -j DROP
🧯 If You Can't Patch
- Implement strict network access controls to limit exposure
- Deploy monitoring and alerting for service crashes or abnormal behavior
🔍 How to Verify
Check if Vulnerable:
Check NanoMQ version: nanomq --version or examine installed version
Check Version:
nanomq --version
Verify Fix Applied:
Verify version is newer than 0.17.2 or check if commit 657e6c81c474bdee0e6413483b990e90610030c1 is applied
📡 Detection & Monitoring
Log Indicators:
- Segmentation fault errors
- Unexpected service termination
- Memory allocation failures
Network Indicators:
- Unusual message patterns triggering nni_msg_get_pub_pid() function
SIEM Query:
source="nanomq" AND ("segmentation fault" OR "buffer overflow" OR "service crashed")
🔗 References
- https://github.com/emqx/nanomq
- https://github.com/emqx/nanomq/issues/1153
- https://github.com/nanomq/NanoNNG/commit/657e6c81c474bdee0e6413483b990e90610030c1
- https://github.com/emqx/nanomq
- https://github.com/emqx/nanomq/issues/1153
- https://github.com/nanomq/NanoNNG/commit/657e6c81c474bdee0e6413483b990e90610030c1