CVE-2026-10638: Use-after-free in Zephyr ICMPv6 RX path when updating statistics after sending an echo reply or error
subsys/net/ip/icmpv6.c reads the network interface from a netpkt after that packet has been handed to nettrysenddata(). In icmpv6handleechorequest() and neticmpv6senderror(), the post-send statistics update calls netpktiface(reply)/netpktiface(pkt) on the just-sent packet.
The send path (nettrysenddata -> netiftx) unreferences and may free the packet back to its memory slab before returning — synchronously in the RX thread when no TX queue is configured (CONFIGNETTCTXCOUNT == 0), and asynchronously the driver/L2 may already have freed it otherwise. netpktiface() therefore dereferences a freed (and possibly reused) netpkt; with CONFIGNETSTATISTICSPERINTERFACE the stale iface pointer is further dereferenced and written through (iface->stats.icmp.sent++), turning the use-after-free read into a write through an attacker-influenceable pointer.
The core stack already documents this hazard in netcore.c ("do not use pkt after that call") and caches iface before sending; the ICMPv6 callers did not.
An unauthenticated remote attacker triggers the flaw simply by sending an ICMPv6 Echo Request (ping) or an IPv6 packet that elicits an ICMPv6 error (unknown next header, fragment reassembly timeout, destination unreachable), leading to denial of service via crash and potential memory corruption. Affected: Zephyr networking with CONFIGNETNATIVEIPV6, roughly v4.2.0 through v4.4.0.
The fix caches the interface pointer before sending and uses it for all statistics updates; the sibling commit 86e21665d46 fixes the identical bug in ICMPv4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
zephyr/subsys/net/ip/icmpv6.cto a version that resolves this vulnerability.Patch 86e21665d46 - Configuration
Apply the fix in the ICMPv6 RX path used by Zephyr when CONFIG_NET_NATIVE_IPV6 is enabled; specifically ensure iface is cached before sending and used for statistics updates rather than calling net_pkt_iface() on the just-sent/released packet.
Zephyr networking (CONFIG_NET_NATIVE_IPV6) CONFIG_NET_NATIVE_IPV6 = enable
Event History
Frequently Asked Questions
What is the severity of CVE-2026-10638?
The severity of CVE-2026-10638 is rated medium with a score of 5.9.
What are the risks associated with CVE-2026-10638?
CVE-2026-10638 poses a risk of use-after-free vulnerabilities in the Zephyr networking stack, potentially leading to denial of service.
How do I fix CVE-2026-10638?
To fix CVE-2026-10638, update to the latest version of the Zephyr software where the vulnerability has been patched.
Which software is affected by CVE-2026-10638?
CVE-2026-10638 affects the Zephyr networking components, particularly within the ICMPv6 handling code.
What is the cause of CVE-2026-10638?
CVE-2026-10638 is caused by the mishandling of a network packet after it has been sent, which leads to reading freed memory.