CVE-2026-95825 in Zephyr
Summary
by MITRE • 11/20/2026
net_if_ipv4_addr_rm() and net_if_ipv6_addr_rm() in subsys/net/ip/net_if.c unconditionally called net_if_addr_unref() on the target address. When an earlier removal could not complete because another subsystem still held a reference (the TCP stack takes one on the local address of every connection, in tcp_conn_new() and on connect()), the address is left in place with is_added cleared and is_used still set. A second removal of such an address decremented the reference count again, consuming a reference owned by that other holder. When it was the last one, the address slot was released, its NET_EVENT_IPV*_ADDR_DEL event fired, and the slot became reusable while the holder still believed it owned a reference.
Every address lookup helper matches on is_used and not on is_added, so a half-removed address stays visible to the rest of the stack and repeat removals are readily reachable from remote input. Under IPv6 SLAAC, an on-link node that sends a Router Advertisement with a short valid lifetime causes the address to expire into the deferred state; a refreshing Router Advertisement is handled by net_if_ipv6_addr_update_lifetime(), which re-arms the lifetime timer without restoring the reference, so the next expiry performs the second, reference-stealing removal. With CONFIG_NET_IPV4_ACD and DHCPv4, repeated spoofed ARP conflicts for the device's lease drive dhcpv4_acd_event_handler() into calling net_if_ipv4_addr_rm() more than once on the same address. Where CONFIG_USERSPACE is enabled, the net_if_ipv4_addr_rm_by_index() and net_if_ipv6_addr_rm_by_index() system calls let an unprivileged user-mode thread trigger the same kernel-side release deterministically.
The impact is loss of a configured IP address while connections are still using it, and a corrupted reference count that propagates: the slot can be handed to a newly added address, and when the stale holder later tears down, net_if_addr_unref() resolves the address by value and drops the new incarnation's only reference, removing a live address a second time. The affected objects are static array slots and the counter is never decremented below zero, so there is no memory corruption or information disclosure; the consequence is denial of service against the device's network connectivity, repeatable at the attacker's pace.
The fix resolves the address before touching the reference count and returns false without calling net_if_addr_unref() when the address is already marked as removed, so the public removal API can no longer consume a reference it does not own.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/21/2026
This vulnerability represents a critical logic error in the network interface subsystem of Zephyr RTOS, specifically within the functions net_if_ipv4_addr_rm and net_if_ipv6_addr_rem located in subsys/net/ip/net_if.c. The core technical flaw stems from an unconditional invocation of net_if_addr_unref on target addresses during removal operations, without adequately verifying whether the address is currently active or already marked for deferred deletion. In normal operation, when a network subsystem such as TCP holds a reference to a local address via tcp_conn_new or connection establishment routines, that reference must remain valid until the connection terminates. However, if an initial removal attempt fails because other subsystems still hold references, the system leaves the address in place with its is_added flag cleared while keeping is_used set. This creates a half-removed state where the address remains visible to lookup helpers but has been logically removed from active configuration lists.
The operational impact of this flaw manifests as a denial of service against network connectivity through reference count corruption and premature resource release. When a second removal operation targets such an already-decremented address, it incorrectly consumes a reference owned by another subsystem like the TCP stack. If this constitutes the final reference held by that external holder, the system releases the address slot entirely and fires NET_EVENT_IPV*_ADDR_DEL events while the original owner still believes it retains ownership of that resource. This leads to situations where configured IP addresses are lost while active connections continue attempting to use them, resulting in communication failures for those specific flows. Furthermore, because lookup functions match on is_used rather than is_added, these half-removed addresses remain visible throughout the stack, allowing repeat removals to be triggered deterministically by remote input or local configuration changes.
Several attack vectors can exploit this vulnerability depending on the enabled configurations and network environment. Under IPv6 Stateless Address Autoconfiguration with short valid lifetimes in Router Advertisements, an attacker sending malicious advertisements can cause addresses to expire into deferred states. Subsequent refreshing of these addresses via net_if_ipv6_addr_update_lifetime re-arms timers without restoring references, leading to a second expiry that performs the destructive removal. Similarly, under IPv4 Address Conflict Detection with DHCPv4 enabled, repeated spoofed ARP conflicts drive dhcpv4_acd_event_handler into calling net_if_ipv4_addr_rm multiple times on the same address. In systems running CONFIG_USERSPACE, unprivileged user-mode threads can deterministically trigger kernel-side releases through system calls like net_if_ipv4_addr_rm_by_index and net_if_ipv6_addr_rm_by_index, providing a reliable path for local privilege escalation to denial of service conditions.
The propagation mechanism involves static array slots where the corrupted reference count allows address slots to be handed to newly added addresses while stale holders still exist. When these stale holders eventually tear down their connections, they invoke net_if_addr_unref which resolves by value and drops the new incarnation's only reference, effectively removing a live address a second time. While this does not result in memory corruption or information disclosure since counters never decrement below zero and objects are static array slots rather than dynamically allocated heap structures, it causes significant instability in network stack behavior. The consequence is strictly denial of service against device connectivity that can be repeated at the attacker's pace without requiring complex exploitation techniques beyond standard packet injection or configuration manipulation.
Mitigation strategies focus on correcting the reference counting logic within the removal functions to ensure addresses are fully resolved before touching reference counts and returning false when an address is already marked as removed. This prevents public APIs from consuming references they do not own, thereby preserving integrity across subsystem boundaries. From a classification perspective, this vulnerability aligns with CWE-362 Concurrent Execution Using Shared Resource with Improper Synchronization due to the race condition between removal operations and active reference holders, as well as CWE-401 Missing Release of Memory after Effective Lifetime which describes the premature release of resources while still in use. In terms of MITRE ATT&CK mapping, this falls under T1499 Endpoint Denial of Service where attackers leverage resource exhaustion or logic errors to disrupt availability rather than compromising confidentiality or integrity directly. System administrators should apply patches that enforce strict state validation before reference decrementing and consider limiting exposure to untrusted network segments if userspace access is enabled in production environments.