CVE-2026-81412 in Nmapinfo

Summary

by MITRE • 11/25/2026

Nmap before 7.992 contains an excessive memory allocation vulnerability in the unmarshall_array function of the NSE msrpctypes.lua library, which trusts the entry count declared by the server. A malicious SMB server on a scanned host can declare an EntriesRead value of 0xFFFFFFFF with an empty buffer, causing a prolonged CPU spin and exhausting the memory of the Nmap process; the library is used by smb-enum-shares.nse in the default script category (-sC, -A).

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified in versions of Nmap prior to 7.992 represents a critical resource exhaustion flaw located within the Network Scripting Engine, specifically affecting the msrpctypes.lua library used for parsing Microsoft Remote Procedure Call (MSRPC) data structures. This component is integral to several default scanning scripts, most notably smb-enum-shares.nse, which is automatically executed during standard service detection scans using flags such as -sC or -A. The core technical deficiency lies in the unmarshall_array function, which processes array data received from SMB servers without performing adequate validation of length fields before memory allocation. Specifically, the function trusts the entry count declared by the remote server to determine how much memory to allocate for storing the parsed elements. This lack of input sanitization creates a direct path for an attacker to manipulate resource consumption on the scanning host.

A malicious or compromised SMB server can exploit this flaw by responding to Nmap's enumeration requests with a crafted packet that declares an EntriesRead value of 0xFFFFFFFF, which corresponds to approximately four billion entries in a thirty-two-bit integer context. Crucially, while the header claims this massive number of entries exist, the actual data buffer accompanying the response is empty or significantly smaller than required for such a volume. When Nmap processes this malformed input, it attempts to allocate memory based on the inflated count rather than the actual payload size. This discrepancy triggers an excessive memory allocation request that far exceeds available system resources. The resulting condition does not merely cause a simple crash but leads to prolonged CPU spinning as the process struggles with the invalid state and eventual failure of memory operations, effectively creating a denial-of-service scenario against the scanning tool itself.

The operational impact of this vulnerability is significant for security professionals who rely on Nmap for network discovery and auditing. Since smb-enum-shares.nse resides in the default script category, any user performing standard scans with -sC or -A flags against untrusted networks risks triggering this condition inadvertently if they encounter a hostile SMB service. The exhaustion of memory can cause the Nmap process to terminate unexpectedly, leading to incomplete scan results and potential data loss for ongoing reconnaissance efforts. Furthermore, in automated scanning environments where multiple hosts are targeted sequentially, a single malicious host could halt or severely degrade the performance of an entire network audit campaign by consuming all available RAM on the scanner's machine. This undermines the reliability and stability of security assessments that depend on consistent tool behavior across diverse network environments.

From a classification perspective, this vulnerability aligns with CWE-789: Memory Allocation with Untrusted Input, as it involves allocating memory based on data received from an external source without proper validation. It also relates to CWE-400: Uncontrolled Resource Consumption, given the outcome of exhausting system resources through excessive allocation requests. In terms of adversary tactics, this flaw could be leveraged within ATT&CK technique T1496: Resource Hijacking, where attackers use compromised or malicious services to consume computational resources and disrupt security operations. The vulnerability highlights a broader class of issues in network scanning tools that must parse untrusted binary protocols from potentially hostile endpoints without sufficient bounds checking on structural metadata fields like array lengths.

Mitigation strategies primarily involve upgrading Nmap to version 7.992 or later, where the msrpctypes.lua library has been patched to validate entry counts against actual buffer sizes before proceeding with memory allocation. Until an upgrade is feasible, users should exercise caution when scanning untrusted networks using default script categories that interact with SMB services. Disabling smb-enum-shares.nse via custom NSE scripts or adjusting scan profiles to exclude specific service detections can reduce exposure risk. Additionally, implementing network-level controls such as firewalls to restrict access to sensitive SMB ports from unknown sources provides a defensive layer against exploitation attempts. Security teams should also monitor for unusual memory usage patterns in their scanning infrastructure that might indicate ongoing abuse of this vulnerability by malicious actors attempting to disrupt reconnaissance activities.

Responsible

VulnCheck

Reservation

08/26/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00450

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!