CVE-2026-81412: Nmap < 7.992 Unbounded Allocation via Server-Declared Array Count in msrpctypes.lua
Nmap before 7.992 contains an excessive memory allocation vulnerability in the unmarshallarray 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).
Affected Software
Event History
Frequently Asked Questions
Are common Nmap scan modes affected?
Yes. The vulnerable library is used by smb-enum-shares.nse, which is included in Nmap's default script category and can run with -sC or -A.
What does an attacker need to do to trigger the issue?
The attacker needs to operate a malicious SMB server on a host being scanned. They can provide an EntriesRead value of 0xFFFFFFFF with an empty buffer to the scanner.
What can be done if upgrading is not immediately possible?
Avoid running smb-enum-shares.nse against untrusted SMB servers, including by avoiding scan modes that invoke the default script category such as -sC and -A. Upgrade Nmap to version 7.992 or later when possible.