CVE-2026-81417 in Nmap
Summary
by MITRE • 11/25/2026
Nmap before 7.992 contains an infinite loop vulnerability in the dispatcher of the NSE tftp.lua library, which removes completed coroutines but not ones that ended in an error, leaving a zero-yield spin. A malicious TFTP exchange reached by snmp-ios-config.nse after an SNMP write sequence can leave a dead coroutine that freezes the entire Nmap invocation, before port scanning begins for any target in the run; the hang is prevented when the script-timeout option is set.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified in versions of Nmap prior to 7.992 represents a significant stability issue within the Lua Scripting Engine, specifically affecting the tftp.lua library and its interaction with the snmp-ios-config.nse script. This flaw manifests as an infinite loop or zero-yield spin condition located in the dispatcher mechanism that manages coroutines during network operations. In normal operation, Nmap utilizes cooperative multitasking via Lua coroutines to handle multiple tasks concurrently without blocking the main execution thread. The tftp.lua library is responsible for handling Trivial File Protocol exchanges, which are often used in conjunction with SNMP configurations on network devices. When a TFTP exchange encounters an error condition rather than completing successfully, the current implementation fails to properly clean up or remove the corresponding coroutine from the dispatcher's active list.
This failure to handle erroneous termination states results in a dead coroutine that remains registered within the execution loop. Because the coroutine has ended but was not removed, and because it yields no further control back to the scheduler due to its error state, the Nmap engine enters a spin loop where it continuously attempts to process this non-functional routine. This behavior effectively freezes the entire Nmap invocation before any port scanning or host discovery activities can commence against the target hosts. The impact is particularly severe in automated environments or when running scripts that trigger SNMP write sequences followed by TFTP operations, as seen with the snmp-ios-config.nse script which attempts to back up configurations from Cisco IOS devices via TFTP after modifying settings through SNMP.
From a classification perspective, this vulnerability aligns with CWE-835, known as Loop Without Ending Condition or Infinite Loop, and specifically relates to improper resource management leading to denial of service conditions. In the context of the MITRE ATT&CK framework, while not an exploit for remote code execution, it represents a potential availability impact that could be leveraged in a Denial of Service scenario against security scanning tools themselves. The flaw highlights a critical gap in error handling within asynchronous network libraries where exception paths do not guarantee proper state cleanup.
Mitigation strategies primarily involve upgrading to Nmap version 7.992 or later, where the dispatcher logic has been corrected to ensure that all coroutines, including those terminated by errors, are properly removed from the execution queue. For environments where an immediate upgrade is not feasible, administrators can mitigate the risk of hanging scans by explicitly setting the script-timeout option when invoking Nmap with affected scripts. This timeout mechanism forces the engine to abort operations that exceed a specified duration, thereby preventing the infinite loop from freezing the process indefinitely. However, relying on timeouts is a workaround rather than a fix, as it may result in incomplete data collection or missed vulnerabilities during security assessments.