MEDIUM 6.5

CVE-2026-58058: Nmap IPv6 Extension Header Buffer Underflow and Out-of-Bounds Read

Nmap versions up to 7.99 contain a flaw in how they process IPv6 extension headers during network scanning. When a target or intermediary sends back a specially crafted IPv6 response with a truncated extension header, Nmap's pointer tracking can advance past the legitimate packet data. This causes the remaining-length counter to underflow—rolling over to an unexpectedly large number—leading to out-of-bounds memory reads and potential crashes. The issue is triggered specifically during raw IPv6 scans and requires no user interaction or authentication.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.5 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Weaknesses (CWE)
CWE-191
Affected products
1 configuration(s)
Published / Modified
2026-06-28 / 2026-06-30

NVD description (verbatim)

Nmap through 7.99 does not keep the IPv6 extension-header walk within the captured packet in ipv6_get_data_primitive (libnetutil/netutil.cc), so the pointer advances past the buffer and the remaining-length computation underflows to a large value. A scanned target or on-path attacker returning a crafted IPv6 response with a truncated extension header can trigger out-of-bounds reads and a crash during raw IPv6 scans.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in libnetutil/netutil.cc within the ipv6_get_data_primitive function. IPv6 packets can contain extension headers that chain together; Nmap walks these headers to extract payload data. The code fails to enforce that pointer advancement stays within the captured packet bounds. When a response includes a truncated extension header, the pointer exceeds the buffer end, and the remaining-length field—computed as an unsigned integer—wraps to a large value due to integer underflow (CWE-191). Subsequent read operations then access memory far beyond the intended range, causing either information disclosure or a denial-of-service crash. The flaw is reachable from the network without authentication or privileges.

Business impact

Organizations relying on Nmap for vulnerability assessment, security scanning, or network reconnaissance face service interruptions when scanning IPv6-enabled targets. An attacker or compromised network path could exploit this to crash Nmap scans, disrupting security operations and delaying incident response or compliance activities. The memory read aspect may leak sensitive data from the scanning process, though impact depends on what data resides adjacent in memory. For blue teams and penetration testers, this could be weaponized defensively by a malicious target to disrupt reconnaissance efforts.

Affected systems

Nmap through version 7.99 is affected. This includes all stable and development releases up to and including 7.99. The flaw is triggered only during IPv6 raw-packet scans, so systems using Nmap exclusively for IPv4 scanning or using higher-level scanning modes that don't rely on raw IPv6 processing face lower risk. Environments actively scanning IPv6 networks or hybrid IPv4/IPv6 infrastructure are most exposed.

Exploitability

Exploitability is straightforward from a network perspective: no authentication, special privileges, or user interaction is required. Any IPv6-capable target or on-path network actor can craft and return a malicious IPv6 response. The attack surface is active—it triggers during the scan itself, not as a separate step. However, the attacker must either control a scanned target or be positioned in-path to inject packets. The required network access and low complexity of packet construction lead to a CVSS score of 6.5 (Medium), reflecting local information disclosure and denial-of-service impact without full system compromise.

Remediation

Upgrade Nmap to a version newer than 7.99 that includes the corrected ipv6_get_data_primitive function. Verify patched versions against official Nmap release notes and security advisories. For organizations unable to patch immediately, restrict raw IPv6 scanning in untrusted network environments, or disable IPv6 scanning if not operationally required. Use network segmentation to reduce exposure to untrusted targets. Monitor Nmap process behavior for crashes and enable logging to detect exploitation attempts.

Patch guidance

Check the official Nmap project website and release notes for versions after 7.99 that address CVE-2026-58058. Apply patches to all systems running Nmap in your security infrastructure, including vulnerability scanners, penetration testing platforms, and security operations workstations. Test patched versions in a non-production environment against your typical IPv6 scanning targets to ensure compatibility. Coordinate patching with security operations to minimize disruption to active scanning schedules.

Detection guidance

Monitor system logs and Nmap process exit codes for unexpected crashes or segmentation faults during IPv6 scans. Implement network-level detection for malformed IPv6 packets with truncated extension headers sent to your scanning infrastructure—such packets are abnormal and may indicate attack attempts. Correlate Nmap crashes with inbound IPv6 traffic from specific targets. Set up alerting for any scanner restarts or failures that coincide with IPv6 reconnaissance activity. In forensic investigations, examine packet captures from failed scans to identify malformed IPv6 responses.

Why prioritize this

Although rated CVSS 6.5 (Medium), this vulnerability warrants prompt attention because Nmap is critical infrastructure for security teams. Any interruption to scanning operations delays threat detection and compliance verification. The network-reachable nature and low attack complexity mean opportunistic exploitation by any responsive target is possible. Organizations with active IPv6 scanning programs should prioritize patching. Those with limited IPv6 infrastructure can defer slightly but should still update within their standard patch cycle.

Risk score, explained

The CVSS 3.1 score of 6.5 reflects: (1) Network-based attack vector with no authentication required, lowering the bar for exploitation; (2) Low attack complexity—crafting a truncated IPv6 extension header is straightforward; (3) Partial confidentiality impact via out-of-bounds reads potentially exposing memory contents; (4) Availability impact through denial of service (scanner crash). The score excludes integrity impact because the flaw does not allow arbitrary writes or command execution. While not critical, the combination of easy exploitation and direct impact on security operations elevates risk for organizations dependent on Nmap.

Frequently asked questions

Do I need to patch if I only use Nmap for IPv4 scanning?

Lower priority, but still recommended. The flaw is specific to raw IPv6 scanning, so exclusive IPv4 use significantly reduces exposure. However, patching remains best practice for comprehensive security posture and prepares your infrastructure for future IPv6 work.

Can this vulnerability be exploited if a target is behind a firewall?

The attacker must be able to send an IPv6 response back through the network to the scanning system. If your scanner is behind a firewall and targets are in untrusted networks, the risk is elevated because any scanned target can attempt the exploit. Internal scanning is lower risk but still vulnerable if insiders or compromised internal systems are involved.

What does 'out-of-bounds read' mean in practical terms?

Nmap's memory reader accesses data from RAM locations it should not access—beyond the packet buffer. This can leak sensitive data (like cryptographic keys or scan results in memory) or crash the application if it hits protected memory. It does not allow arbitrary code execution.

Are there workarounds if I cannot patch immediately?

Temporarily disable IPv6 scanning in your Nmap configuration, or restrict raw IPv6 scans to trusted internal networks only. Use network segmentation to isolate scanners from untrusted targets. These are temporary measures; patching is the proper fix.

This analysis is provided for informational purposes to support security decision-making. The technical details and risk assessment are based on the published CVE record and CVSS scoring; however, real-world impact may vary based on your specific infrastructure, network architecture, and use of Nmap. Always verify patch availability and compatibility with your systems before deployment. SEC.co does not guarantee the completeness or timeliness of vulnerability information and recommends consulting official vendor advisories and your internal risk assessment processes. No warranty is provided regarding the accuracy of this enrichment or its suitability for any particular purpose. Source: NVD (public-domain), retrieved 2026-08-06. Analysis generated by SEC.co (claude-haiku-4-5).