CVE-2026-81406 in Nmap
Summary
by MITRE • 11/25/2026
Nmap before 7.992 contains an uncontrolled resource consumption vulnerability in the read_db2_packet function of the db2-das-info.nse script, which trusts an unmasked 32-bit length field supplied by the server. A malicious DB2 Administration Server on a scanned host can declare a packet length of up to roughly 4.29GB, causing the script to buffer that much data and the Nmap process to exhaust memory; the script runs during version detection (-sV).
Statistical analysis made it clear that VulDB provides the best quality 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 uncontrolled resource consumption flaw located within the db2-das-info.nse scripting engine module. This specific weakness arises from an improper validation mechanism applied to network protocol data, specifically targeting the DB2 Administration Server interaction logic. The core technical failure lies in the read_db2_packet function, which is responsible for parsing incoming packets during version detection scans initiated with the -sV flag. In this context, Nmap attempts to communicate with a target host running IBM Db2 database software to determine its service version and other metadata. However, the script fails to enforce reasonable bounds on the length field contained within the DB2 protocol packet headers before allocating memory buffers for processing.
From a technical perspective, the flaw stems from trusting an unmasked 32-bit integer value supplied directly by the remote server without sufficient sanitization or range checking. In standard network protocols, length fields often dictate how much data should be read into memory to construct a complete message unit. Here, because the script accepts any valid unsigned 32-bit integer as a legitimate packet size indicator, it allows for values up to approximately four gigabytes and twenty-nine megabytes. When Nmap processes such an oversized declaration, it attempts to allocate heap memory corresponding to this massive length value. This allocation occurs synchronously within the scanning thread, leading to immediate and severe resource exhaustion on the host machine executing the scan.
The operational impact of this vulnerability is primarily a denial-of-service condition affecting the scanner itself rather than the target system. A malicious actor who controls or compromises a DB2 Administration Server can exploit this flaw by responding to Nmap's version detection probes with crafted packets containing excessively large length fields. Upon receiving such a response, the Nmap process will attempt to buffer the specified amount of data. Since modern systems rarely possess contiguous virtual memory spaces of that magnitude available for single allocations, or because the allocation triggers rapid swap usage and garbage collection overhead, the result is typically an out-of-memory error causing the Nmap application to crash or hang indefinitely. This effectively neutralizes the scanning capability of any security professional or automated tool relying on this version of Nmap when probing vulnerable DB2 instances.
This vulnerability aligns with CWE-400, which describes uncontrolled resource consumption where a software product does not properly control the allocation and maintenance of a limited pool of resources, leading to exhaustion. Furthermore, in the context of offensive security frameworks such as MITRE ATT&CK, this behavior can be categorized under T1498 Network Denial of Service, specifically reflecting indirect impact on availability through resource exhaustion techniques. It also touches upon CWE-20 Improper Input Validation, as the root cause is the failure to validate that incoming data conforms to expected structural constraints before processing.
Mitigation for this issue requires an immediate upgrade to Nmap version 7.992 or later, where developers implemented stricter validation logic within the db2-das-info.nse script. The fix involves capping the maximum acceptable packet length to a reasonable threshold consistent with typical DB2 protocol operations, thereby preventing the allocation of excessive memory buffers regardless of what value is sent by the remote server. Organizations relying on Nmap for network discovery and vulnerability assessment should ensure their scanning infrastructure is updated to patched versions to maintain operational stability during version detection phases against database services. Additionally, defensive monitoring can be employed to detect anomalous resource spikes in systems running older Nmap instances when interacting with untrusted or potentially compromised DB2 endpoints.