Reach nmap · 4 builds in 4 of 4 releases
full reviewcross-check✓ a member decided
Description · NVD
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.
Published 2026-06-28NVD
CVSS 4.0Network · no privileges · no user interaction
How it is reached
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
What it costs
- Confidentiality
- Low
- Integrity
- None
- Availability
- Low
What it costs other systems
- Confidentiality
- None
- Integrity
- None
- Availability
- None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
Fable 5.1 · high confidence · 2026-11-05
The vulnerable IPv6 extension-header walk is present unchanged in output/build/nmap-7.95/libnetutil/netutil.cc (ipv6_get_data_primitive, lines 623-630): the loop advances p by the header length with no check that it stays within end, then computes *len = end - p, which underflows. Neither of the two Buildroot patches touches this file and no backport is present.
nmap, nping and ncat are all selected (BR2_PACKAGE_NMAP_NMAP/NPING=y), built with --enable-ipv6, and installed to /usr/bin.
The web UI (enabled in the factory default via infix-services:web/enabled=true, run as root by finit) exposes a Diagnostics page that spawns nmap -n [-6] [-F|-sV|-sn] <target>; as root nmap uses raw scans whose pcap read path (tcpip.cc:1424, scan_engine_raw.cc:173/438/1627) calls the vulnerable function, so a scanned IPv6 host or on-path attacker returning a crafted truncated extension header can crash the scan.
Trigger requires an authenticated web UI user to launch an IPv6 scan; impact is a crash/OOB read of the short-lived nmap child, not the management daemon.
Evidence 12
Vulnerable loop: `p += (*(p + 1) + 1) * 8;` with no post-advance bounds check, followed by `*len = end - p;` — upstream fix bb6754e is not present
output/build/nmap-7.95/libnetutil/netutil.cc:623-630 (ipv6_get_data_primitive)
Only 0001-libdnet-always-build-a-static-library.patch and 0002-nping-Crypto.cc-fix-build-with-libressl-3.5.0.patch applied; neither touches libnetutil
output/build/nmap-7.95/.applied_patches_list
BR2_PACKAGE_NMAP=y, NMAP_NCAT=y, NMAP_NMAP=y, NMAP_NPING=y — package selected directly for the target
output/.config:3411-3414 and configs/x86_64_defconfig:87-90
Built with --enable-ipv6 --with-ncat --with-nping; libnetutil compiled into nmap and nping
output/build/nmap-7.95/config.log (configure invocation)
Binaries installed into the target image
output/target/usr/bin/nmap, nping, ncat
Raw-scan pcap read paths call ipv6_get_data/ip_get_data on received packets — reached during raw IPv6 scans (root)
output/build/nmap-7.95/tcpip.cc:1424; scan_engine_raw.cc:173,438,1627; nping/ProbeMode.cc:1480
Web UI diagnostics spawns `nmap -n [-6] [-F|-sV|-sn] [-e iface] target` via exec.CommandContext (line 302)
src/webui/internal/handlers/diagnostics.go:212-233
Routes GET /maintenance/diagnostics and /maintenance/diagnostics/run wired to the DiagnosticsHandler
src/webui/internal/server/server.go:307-308
webui service runs as root (no user/group drop), so child nmap gets raw-socket privileges
output/target/etc/finit.d/available/webui.conf
confd enables the webui finit service when infix-services:web/enabled is true; factory default sets enabled=true
src/confd/src/services.c:860 and src/confd/share/factory.d/10-infix-services.json:24-26
YANG node /infix-services:web/enabled controls the web UI (operator can disable to remove this path)
src/confd/yang/confd/infix-services.yang:311-330
No finit service runs nmap/nping/ncat as a daemon; nmap only runs on demand
board/common/rootfs/etc/finit.conf, finit.d/
Version and patches
NVD/advisory: affected nmap through 7.99; fixed upstream by commit bb6754e76bb1686315008e1aa1c40202a513fb83 (post-7.99). Our 7.95 is inside the range and the source in the build dir shows the unfixed function. Buildroot patches applied (libdnet static lib, nping Crypto.cc libressl) are unrelated; no IGNORE_CVES entry.
Recommendation
Backport upstream commit bb6754e (small bounds check in libnetutil/netutil.cc ipv6_get_data_primitive) as a Buildroot patch for nmap 7.95, or upgrade once a fixed release ships. Severity in context is moderate: the trigger needs an authenticated admin to run an IPv6 scan from the web UI Diagnostics page against a malicious/on-path host, and the consequence is a crash/OOB read of the transient root-owned nmap child, not of the management plane. Interim mitigation: operators can disable the web UI (/infix-services:web/enabled=false) or avoid IPv6 scans of untrusted targets.
Open questions
The web UI middleware (src/webui/internal/server/middleware.go) was not fully reviewed to confirm the diagnostics route sits behind session authentication; it is assumed to be authenticated like the rest of the management UI. The CLI (klish-plugin-infix xml) has no nmap/nping command, so only the web UI and a root shell invoke it.
Members of Kernel Kit decide. Sign in if you are one.