CVE-2026-137978 in Nmapinfo

Summary

by MITRE • 11/27/2026

Nmap before 7.992 contains a use-after-free vulnerability in DNS::ResolverImpl::process_request in libnetutil/massdns.cc that frees still-referenced requests when rescheduling after DNS server disconnects. Attackers answering for at least two configured DNS servers can force a disconnect and send a precisely timed response to crash the scan, possibly enabling code execution.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in Nmap versions prior to 7.992 represents a critical memory management flaw within the library netutil component, specifically located in the massdns.cc source file under the DNS::ResolverImpl::process_request function. This issue is classified as a use-after-free error, which occurs when program execution continues to reference a memory block after it has been deallocated by the system. In this specific context, the vulnerability arises during the rescheduling of DNS requests following a disconnection event from one or more configured DNS servers. When Nmap attempts to manage its asynchronous network operations, it fails to properly invalidate pointers to request structures that are still actively referenced in memory queues or callback handlers before those structures are freed. This logical error creates a window where the application may attempt to access or modify data at an address that no longer holds valid information for that specific object instance.

The operational impact of this vulnerability is significant, primarily due to its potential for remote exploitation under specific network conditions. An attacker who controls or can spoof responses from at least two configured DNS servers can engineer a scenario where the Nmap process experiences a forced disconnection. By carefully timing their response packets, an adversary can trigger the race condition that leads to the premature freeing of request objects while they are still being processed by the resolver logic. The immediate consequence of this memory corruption is typically a segmentation fault or application crash, which disrupts the scanning operation and denies service to the user running Nmap. However, given the nature of use-after-free vulnerabilities in C++ applications that handle network data, the risk extends far beyond simple denial of service. An attacker with sufficient control over the input data sent via these DNS responses may be able to overwrite adjacent memory structures or function pointers within the heap layout.

This capability enables arbitrary code execution on the target system where Nmap is running. By manipulating the freed memory contents through crafted DNS packets, an adversary can redirect program flow to execute malicious shellcode injected into the process address space. This transforms a routine network scanning tool into a potential attack vector against the security analyst or administrator operating it. The vulnerability aligns with CWE-416, which defines use-after-free conditions as a distinct class of software weaknesses leading to unpredictable behavior and privilege escalation. Furthermore, from an offensive security perspective, this exploitation technique maps closely to ATT&CK techniques involving memory corruption for initial access or defense evasion, specifically leveraging the trust placed in network responses by administrative tools.

Mitigation strategies focus primarily on version upgrades and operational hardening. The most effective remediation is to upgrade Nmap to version 7.992 or later, where the developers have addressed the reference counting logic within the DNS resolver implementation to ensure that objects are not freed while still in use. For environments where immediate upgrading is not feasible, operators should restrict the sources of DNS responses accepted by Nmap during scans. This can be achieved by configuring strict firewall rules to allow DNS traffic only from trusted and verified resolvers, thereby preventing attackers from injecting malicious packets into the communication stream. Additionally, enabling Address Space Layout Randomization on the operating system running Nmap can increase the difficulty of successful exploitation by making it harder for an attacker to predict memory addresses required for reliable code execution. Regular patch management protocols should be enforced to ensure that such high-severity vulnerabilities in commonly used security tools are addressed promptly to maintain the integrity of network assessment activities.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!