CVE-2026-137979 in Nmapinfo

Summary

by MITRE • 11/27/2026

Nmap before 7.992 contains an information disclosure vulnerability in the Nmap Scripting Engine because nse_main.lua does not explicitly seed Lua's math.random generator. Malicious scanned hosts can observe math.random-derived values in NSE script traffic during -sC scans, brute-force the seed, and recover a heap address that weakens ASLR.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in versions of Nmap prior to 7.992 represents a critical flaw within the Nmap Scripting Engine, specifically rooted in the initialization practices of its underlying Lua scripting environment. The core technical deficiency lies in the nse_main.lua script, which fails to explicitly seed the math.random pseudo-random number generator provided by Lua. In many programming environments and cryptographic contexts, relying on default seeding mechanisms is considered a significant security anti-pattern because these defaults often derive randomness from sources with low entropy or predictable states, such as system time or process identifiers that can be easily observed or guessed by an attacker. By omitting the explicit seeding step using high-entropy data like /dev/urandom or similar secure random number generators, Nmap leaves its internal script execution logic vulnerable to statistical analysis and prediction attacks.

This lack of proper entropy initialization has direct operational consequences for network security assessments that utilize the -sC flag, which triggers default scripts via the NSE. During such scans, various Lua-based scripts generate traffic patterns or data structures influenced by math.random values. Because these values are not sufficiently randomized due to the weak seed, they exhibit predictable statistical properties. A malicious host targeted during a scan can intercept and analyze this network traffic. By observing the specific random-derived values transmitted in packets associated with NSE script execution, an attacker can perform offline brute-force attacks against the limited state space of the unseeded or poorly seeded generator to deduce the initial seed value used by Lua at the start of the session.

The successful recovery of this seed allows for a more sophisticated exploitation vector involving memory layout manipulation. Once the internal random number generation sequence is predictable, an attacker can anticipate values that influence heap allocation patterns or pointer assignments within the Nmap process itself. This predictability effectively neutralizes Address Space Layout Randomization (ASLR), a fundamental operating system security feature designed to prevent code execution attacks by randomly arranging key areas of a program's memory space. By weakening ASLR through this information disclosure, an attacker gains precise knowledge of memory addresses, which significantly lowers the barrier for executing arbitrary code or escalating privileges if other vulnerabilities exist within the Nmap binary or its dependencies.

From a classification perspective, this vulnerability aligns with CWE-330: Use of Insufficiently Random Values and CWE-200: Exposure of Sensitive Information to an Unauthorized Actor. It also maps to MITRE ATT&CK techniques related to Discovery, specifically those involving the collection of information from running processes or network interactions that can be leveraged for further exploitation. The impact is not merely informational; it serves as a stepping stone for more severe attacks by compromising the integrity of memory protection mechanisms on the scanning host.

To mitigate this risk, organizations must upgrade Nmap to version 7.992 or later, where the nse_main.lua script has been patched to properly initialize the Lua random number generator with high-entropy data. Until such an update is applied in legacy environments, administrators should exercise extreme caution when running default scripts against untrusted networks and consider disabling automatic scripting features during scans of sensitive targets. Additionally, ensuring that ASLR remains enabled at the operating system level provides a secondary layer of defense, although it does not fully compensate for the fundamental flaw within the application's random number generation logic. Regular patch management is essential to close these gaps in security tooling, as vulnerabilities in widely used utilities like Nmap can inadvertently expose infrastructure details or weaken host defenses during routine operational activities.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!