7.5
HIGH CVSS 3.1
CVE-2026-95823
Use-after-free and net_buf leak in Zephyr TCP header linearization (tcp_pkt_linearize)
Description

tcp_pkt_linearize() in subsys/net/ip/tcp.c is used by th_get() whenever a received TCP header is not contiguous in a single net_buf. While pulling the header bytes out of the following fragments, the loop called net_buf_unref() on an emptied fragment without first detaching its frags pointer. net_buf_unref() walks the whole fragment list, so the payload buffers still linked behind that fragment were freed as well, and the stale pointer was then reinstalled into the packet as buf->frags, producing a use-after-free and a later double free during packet teardown. The same loop also advanced to second->frags unconditionally: when the fragment still held payload after the header remainder was pulled, it was spliced out of the packet without ever being unreferenced, permanently leaking that buffer and silently dropping the data it carried. The defect is reached from tcp_recv() via th_get() on every received TCP segment, before connection lookup or any header validation, so a single unauthenticated segment that matches a listening socket is sufficient. An attacker only needs the TCP header to straddle a net_buf boundary, which they can arrange from off-link: IPv6 extension headers are accepted on receive and their length is added to the header offset by th_get(), so a Destination Options header of a suitable length places the TCP header across the boundary of the fixed-size receive buffers (CONFIG_NET_BUF_DATA_SIZE). Packet chains assembled from several sources - IPv4/IPv6 reassembly, 6LoWPAN/802.15.4 reassembly, tunnel or virtual interfaces that strip an outer header, or drivers producing scatter-gather chains - can additionally present a short interior fragment that the loop empties exactly, which is the case that frees the remainder of the packet while it is still in use. The reliably reachable consequence is exhaustion of the receive buffer pool: each crafted segment leaks one net_buf from the fixed CONFIG_NET_BUF_RX_COUNT pool, the buffers are never reclaimed, and once the pool is empty the device can no longer receive network traffic until it is rebooted. Where a fragment is emptied exactly, the impact rises to memory corruption: freed pool buffers are written through by the remainder of the loop, their contents may be delivered to the application, and the packet is double-freed on teardown. The fix saves and clears second->frags before the net_buf_unref() so only the emptied header fragment is released, and advances to the next fragment only when second->len == 0, keeping any fragment that still holds payload in the packet. This restores the detach-before-unref ownership pattern used elsewhere in the stack, for example in net_pkt_trim_buffer().

INFO

Published Date :

Nov. 18, 2026, 2:23 p.m.

Last Modified :

Nov. 18, 2026, 2:23 p.m.

Remotely Exploit :

No

Source :

zephyr
Affected Products

The following products are affected by CVE-2026-95823 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Zephyrproject zephyr
2 Zephyrproject zephyr
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 3.1 HIGH e2e69745-5e70-4e92-8431-deb5529a81ad
CVSS 3.1 HIGH MITRE-CVE
Solution
Apply the fix to save and clear fragment pointers before unreferencing to prevent memory corruption and buffer leaks.
  • Save and clear fragment pointers before net_buf_unref.
  • Advance to the next fragment only when length is zero.
  • Restore the detach-before-unref ownership pattern.
  • Keep fragments with payload in the packet.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2026-95823 vulnerability anywhere in the article.

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.