CVE-2024-8376
📋 TL;DR
This vulnerability in Eclipse Mosquitto allows attackers to cause memory corruption through specific MQTT packet sequences, potentially leading to crashes or remote code execution. It affects all deployments running Mosquitto versions up to 2.0.18a. The vulnerability can be exploited by sending malicious CONNECT, DISCONNECT, SUBSCRIBE, UNSUBSCRIBE, and PUBLISH packets.
💻 Affected Systems
- Eclipse Mosquitto
📦 What is this software?
Mosquitto by Eclipse
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data exfiltration, or persistent backdoor installation.
Likely Case
Service disruption through crashes (segmentation faults) causing denial of service and potential memory corruption.
If Mitigated
Limited impact with proper network segmentation and monitoring, potentially only causing service restarts.
🎯 Exploit Status
Exploitation requires specific packet sequences but no authentication. No public exploit code has been released.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.0.19
Vendor Advisory: https://github.com/eclipse/mosquitto/releases/tag/v2.0.19
Restart Required: Yes
Instructions:
1. Download Mosquitto 2.0.19 from official repository. 2. Stop the Mosquitto service. 3. Backup configuration files. 4. Install the new version. 5. Restart the Mosquitto service.
🔧 Temporary Workarounds
Network Filtering
allImplement network filtering to block suspicious MQTT packet sequences
Rate Limiting
allApply rate limiting to MQTT connections to reduce attack surface
🧯 If You Can't Patch
- Implement strict network segmentation to isolate Mosquitto instances
- Deploy intrusion detection systems to monitor for abnormal MQTT traffic patterns
🔍 How to Verify
Check if Vulnerable:
Check Mosquitto version with 'mosquitto -v' or 'dpkg -l | grep mosquitto' on Debian-based systems
Check Version:
mosquitto -v
Verify Fix Applied:
Verify version is 2.0.19 or higher using version check command
📡 Detection & Monitoring
Log Indicators:
- Multiple rapid CONNECT/DISCONNECT sequences
- Unexpected segmentation fault logs
- Memory allocation errors
Network Indicators:
- Abnormal MQTT packet sequences
- Rapid connection churn
- Unusual SUBSCRIBE/UNSUBSCRIBE patterns
SIEM Query:
source="mosquitto.log" AND ("segmentation fault" OR "memory leak" OR "heap-use-after-free")
🔗 References
- https://github.com/eclipse-mosquitto/mosquitto/commit/1914b3ee2a18102d0a94cbdbbfeae1afa03edd17
- https://github.com/eclipse/mosquitto/releases/tag/v2.0.19
- https://gitlab.eclipse.org/security/cve-assignement/-/issues/26
- https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/216
- https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/217
- https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/218
- https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/227
- https://mosquitto.org/