CVE-2023-33658

7.5 HIGH

📋 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

Products:
  • NanoMQ
Versions: 0.17.2 and potentially earlier versions
Operating Systems: All platforms running NanoMQ
Default Config Vulnerable: ⚠️ Yes
Notes: Any deployment using the vulnerable function nni_msg_get_pub_pid() is affected

📦 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

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

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

linux

Restrict 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

📤 Share & Export