GHSA-9w9h-x3fh-m3fp: NULL pointer dereference in the BSD raw IPv6 send path when the destination table is full
GHSA ID |
|
|---|---|
CVE ID |
CVE‑2026‑115403 |
Severity |
High |
CWE |
|
Published |
2026‑11‑01 |
Last updated |
2026‑11‑01 |
Affected packages
| Package | Vulnerable versions | Patched versions |
|---|---|---|
NetX Duo |
>= 6.0, ⇐ 6.5.2.202603a |
6.5.2.202603b |
Description
Summary
_nxd_bsd_ipv6_packet_send, which sends the IPv6 packets an application writes, header included, to a BSD raw socket, can add the destination to the destination table and then read the entry the add returns without checking that the add succeeded. This happens when the destination is reached through a default router whose neighbour cache entry is not yet known. When the table is full, the add fails and returns a NULL entry, and the function dereferences it.
Details
When the destination is not in the destination table and is not on the link, the function asks _nxd_ipv6_router_lookup for a default router. If no router is reachable, the lookup still succeeds with the first valid router on the interface and returns that router’s neighbour cache entry, which may be NULL. A router added by the application with nxd_ipv6_default_router_add has no neighbour cache entry until its Neighbor Advertisement is processed, and a router’s entry is cleared when the neighbour cache deletes it.
The function then calls _nx_icmpv6_dest_table_add. That call returns NX_NOT_SUCCESSFUL with the entry set to NX_NULL when the destination table has no free entry, or when no neighbour cache entry can be added for the next hop. With no neighbour cache entry from the lookup, the function reads dest_entry_ptr → nx_ipv6_destination_entry_nd_entry before it tests the status:
status = _nx_icmpv6_dest_table_add(ip_ptr, dest_addr, &dest_entry_ptr, ...);
if(!NDCacheEntry)
NDCacheEntry = dest_entry_ptr -> nx_ipv6_destination_entry_nd_entry;
The status is tested four lines later, too late. The core IPv6 send path, _nx_ipv6_packet_send, contains the same block with the status tested first, and the on-link branch of this function also tests it first.
The destination table fills through the device’s own traffic to distinct destinations. With NX_ENABLE_IPV6_PATH_MTU_DISCOVERY, received ICMPv6 Packet Too Big messages that quote distinct destinations also fill it.
Impact
The dereference runs in the thread that sends on the raw socket.
Measured on the ThreadX Linux port, with a default router added by the application and never answering, and a destination table of 32:
-
with the table not full, the raw send succeeds;
-
after the table was filled by the device’s own UDP traffic to 34 off-link destinations, the next raw send to a new off-link destination ended with SIGSEGV in
_nxd_bsd_ipv6_packet_send; -
with path MTU discovery enabled, 32 Packet Too Big messages received from the router’s link-local address filled the table, and the next raw send ended the same way.
On other targets the effect depends on what is mapped at the faulting address, which is the offset of nx_ipv6_destination_entry_nd_entry from address 0. This was not measured. Where that memory is readable, the word read there is used as the neighbour cache entry for the send.
Affected configurations
Builds with NX_BSD_ENABLE, NX_BSD_RAW_SUPPORT and FEATURE_NX_IPV6, in which the application sends on an AF_INET6 raw socket with IP_RAW_IPV6_HDRINCL set. The destination must be off the link and not yet in the destination table, the default router’s neighbour cache entry must be unknown, and the destination table must be full or the neighbour cache unable to take the next hop.
Affected versions: [6.0, 6.5.2.202603a].
Severity
CVSS-B 8.2 (High): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N. CWE-476 and CWE-252.
The attack vector is the network because a remote sender can fill the destination table with Packet Too Big messages. Attack requirements are present: the crash also needs the application to send a raw IPv6 packet, with its own header, to a new off-link destination while the default router is unresolved, and the sender controls none of that.
Patches
Fixed in NetX Duo 6.5.2.202603b. The fix tests the status before using the entry, as _nx_ipv6_packet_send does:
if((status == NX_SUCCESS) && (!NDCacheEntry))
NDCacheEntry = dest_entry_ptr -> nx_ipv6_destination_entry_nd_entry;
A failed add then reaches the existing status check below it, which releases the packet. No public API changes, so applications need no source change.
Proof, measured on dev: the regression test netx_bsd_raw_ipv6_dest_table_full_test adds a default router that never answers, fills the destination table, and sends one raw IPv6 packet with its own header to a new off-link destination. Without the change it fails with SIGSEGV in 5 of 5 runs. With it, it passes in 20 of 20: the send returns, the packet is released, and the destination is not added.