CVE-2026-137977 in Nmapinfo

Summary

by MITRE • 11/27/2026

Nmap before 7.992 contains a use-after-free vulnerability in DNS::ResolverImpl::handle_write in libnetutil/massdns.cc that dereferences freed request objects after writes complete. Attackers controlling or on-path to a DNS server can send timed DNS responses with forged ICMP port-unreachable messages to crash scans, disclose memory, or hijack execution.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in Nmap versions prior to 7.992 represents a critical use-after-free condition located within the massDNS resolution module, specifically in the handle_write function of libnetutil/massdns.cc. This flaw arises from improper memory management practices where the software fails to verify that an object remains valid before dereferencing it after asynchronous write operations complete. In high-performance network scanning scenarios involving DNS enumeration, Nmap manages multiple concurrent requests and their associated response handlers. When a request is cancelled or times out, the underlying data structures are freed; however, if subsequent callbacks attempt to access these deallocated memory regions due to race conditions or logic errors in state tracking, the application triggers undefined behavior. This specific implementation flaw allows an attacker who controls the network path between Nmap and its target DNS server to exploit this timing window by manipulating packet delivery sequences.

From a technical perspective, the exploitation vector relies on precise control over network latency and error signaling. An adversary positioned on-path or controlling the destination DNS infrastructure can craft malicious ICMP port-unreachable messages that are timed to arrive after the initial write operation has completed but before the memory cleanup routine finishes executing. By injecting these forged ICMP errors at critical junctures, the attacker forces the resolver to process a state change while still holding references to freed request objects. This sequence of events leads directly to a use-after-free condition, which is categorized under CWE-416 in standard vulnerability classification systems. The ability to manipulate memory access patterns through network-level interference highlights the complexity of securing asynchronous I/O operations against active man-in-the-middle attacks or compromised upstream infrastructure.

The operational impact of this vulnerability extends beyond simple service disruption. While a denial-of-service condition is achieved by causing Nmap scans to crash, the more severe consequence involves information disclosure and potential remote code execution. By carefully crafting the forged ICMP responses, an attacker can influence how the freed memory is reused or inspected during subsequent operations. This may lead to the leakage of sensitive internal state data from the scanner's process space, potentially revealing details about target networks, scan strategies, or other active sessions. In worst-case scenarios where heap metadata corruption occurs due to improper dereferencing, an attacker might achieve arbitrary code execution by overwriting function pointers or control flow structures within the Nmap binary. This transforms a local memory safety error into a significant threat against both the integrity and confidentiality of network reconnaissance activities.

Mitigation strategies for this vulnerability primarily involve upgrading to patched versions of Nmap that address the race condition in massdns.cc. Developers have implemented stricter checks to ensure that request objects are not accessed after their lifecycle has ended, effectively neutralizing the use-after-free trigger. In environments where immediate patching is not feasible, network segmentation and strict firewall rules can limit exposure by preventing untrusted hosts from injecting ICMP error messages into the communication channel between Nmap and DNS servers. Additionally, enabling Address Sanitizer during development builds or deploying runtime memory protection mechanisms such as heap hardening techniques in production systems can provide additional layers of defense against exploitation attempts. Organizations should also review their network architecture to ensure that critical scanning tools are not reliant on untrusted upstream resolvers for time-sensitive operations without adequate validation and isolation controls.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!