Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
The trigger is a non-attacker-controlled timing race, so AV:L and AC:H; no privileges or user interaction are needed to reach the code path, but memory corruption yields full C/I/A impact.
Primary rating from Vendor (zephyr).
CVSS VectorNVD
Lifecycle Timeline
9DescriptionNVD
The Zephyr net_buf library (lib/net_buf/buf.c) manipulated both of its reference counts -- the per-header buf->ref and the per-data-block ref_count at the start of each variable/heap data allocation -- with plain non-atomic C operators (buf->ref++, if (--buf->ref > 0), if (--(*ref_count))). The API is documented as self-synchronizing: callers may share one buffer across threads (e.g. via k_fifo) and each holder independently calls net_buf_unref() with no surrounding lock. Under true concurrency (SMP, or single-core preemption between the non-atomic load and store while another context unrefs the same buffer), two holders can both observe the same prior reference value and both conclude they are the last reference. For heap/variable-data pools (mem_pool_data_unref/heap_data_unref, used by zbus message subscribers, the IP stack RX/TX buffers when CONFIG_NET_BUF_FIXED_DATA_SIZE=n, capture, wireguard, ISO-TP and usbip) this produces a double k_heap_free()/k_free() of the same block -- heap-metadata corruption and a use-after-free on the heap-hardening poison pattern. For the per-header refcount the buffer is returned to the pool free LIFO twice for any pool type (including fixed-data pools used by Bluetooth and networking), corrupting the free list so a later allocation hands the same buffer to two owners. The fix converts both refcounts to atomic_inc/atomic_dec (overlaying buf->ref in an atomic_t-sized union and changing the data-block refcount from uint8_t to atomic_t). Impact is gated on genuine concurrency and on an application architecture that shares one buffer among multiple independent unref'ers; the trigger is a refcount/timing race rather than packet content, so an external attacker has at most weak indirect influence over the race window. Affects all Zephyr releases through v4.4.0.
AnalysisAI
Non-atomic reference-count manipulation in the Zephyr RTOS net_buf library (lib/net_buf/buf.c) allows a double-free/use-after-free when a single buffer is shared and independently unref'd across concurrent contexts. Because buf->ref and the per-data-block ref_count were incremented/decremented with plain C operators despite the API being documented as self-synchronizing, two holders racing net_buf_unref() under SMP or single-core preemption can each conclude they hold the last reference, causing a double k_heap_free()/k_free() (heap-metadata corruption and UAF on heap-hardening poison) for heap/variable-data pools, or a double return to the pool free list for any pool type. All Zephyr releases through v4.4.0 are affected; no public exploit is identified at time of analysis and EPSS risk is low (0.16%, 6th percentile).
Technical ContextAI
Zephyr is a widely-used real-time operating system for resource-constrained embedded and IoT devices. Its net_buf library provides reference-counted buffers passed between subsystems and threads (e.g. handed off through a k_fifo), and the public contract states each holder may independently call net_buf_unref() with no surrounding lock. Two counters exist: the per-header buf->ref inside struct net_buf, and a per-data-block ref_count at the start of each variable/heap data allocation. Both were mutated with non-atomic read-modify-write sequences (buf->ref++, if (--buf->ref > 0), if (--(*ref_count))), which is the root cause captured by CWE-415 (Double Free). Under genuine concurrency the load and store are not indivisible, so two contexts can read the same prior value and both drive the counter to the 'last reference' state. The fix overlays buf->ref in an atomic_t-sized union (packed with the write-once flags/pool_id/user_data_size bytes) and converts the data-block ref_count from uint8_t to atomic_t, replacing operations with atomic_inc/atomic_dec. Affected consumers include zbus message subscribers, the IP stack RX/TX buffers when CONFIG_NET_BUF_FIXED_DATA_SIZE=n, packet capture, WireGuard, ISO-TP, usbip, and (for the header refcount) Bluetooth and networking fixed-data pools.
RemediationAI
Vendor-released patch: upgrade to Zephyr v4.5.0, which contains the fix (per EUVD the fixed version is 4.5.0); the change converts both reference counts to atomic operations in commit 9bb2878319d5f46c29ab5fe855a378d87cd75fc3 (https://github.com/zephyrproject-rtos/zephyr/commit/9bb2878319d5f46c29ab5fe855a378d87cd75fc3) and is documented in advisory GHSA-284j-5jm9-55hh (https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-284j-5jm9-55hh). If you cannot upgrade the whole tree, backport that single self-contained commit (net_buf.h union plus the buf.c atomic_inc/atomic_dec conversion) to your Zephyr version. As compensating controls until patched: avoid application designs where one net_buf is shared and independently net_buf_unref'd by multiple concurrent contexts - have a single owner perform the final unref, or serialize unref calls behind your own lock (trade-off: added latency and code changes); on single-core builds you can shrink the preemption window by not preempting between paired ref/unref sequences, and where feasible prefer fixed-data pools with a single-consumer handoff model, accepting that this does not eliminate the header-refcount race and is risk-reduction only, not a fix.
Potential off-by-one buffer overflow vulnerability in the Zephyr fuse file system. Rated critical severity (CVSS 10.0),
Possible variant of CVE-2021-3434 in function le_ecred_reconf_req. Rated critical severity (CVSS 9.8), this vulnerabilit
Unchecked user input length in /subsys/net/l2/wifi/wifi_shell.c can cause buffer overflows. Rated critical severity (CVS
Potential buffer overflow vulnerability in the Zephyr CAN bus subsystem. Rated critical severity (CVSS 9.8), this vulner
Integer Underflow in 6LoWPAN IPHC Header Uncompression in Zephyr. Rated critical severity (CVSS 9.8), this vulnerability
Buffer overflow in Zephyr USB DFU DNLOAD. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable
DOS: Incorrect 802154 Frame Validation for Omitted Source / Dest Addresses. Rated critical severity (CVSS 9.8), this vul
zephyr-rtos version 1.12.0 contains a NULL base pointer reference vulnerability in sys_ring_buf_put(), sys_ring_buf_get(
Potential buffer overflow vulnerabilities n the Zephyr Bluetooth subsystem. Rated critical severity (CVSS 9.6), this vul
Buffer overflow in Zephyr RTOS dns_unpack_name() function causing OOB writes. PoC available.
The documentation specifies that the BT_GATT_PERM_READ_LESC and BT_GATT_PERM_WRITE_LESC defines for a Bluetooth characte
Potential buffer overflows in the Bluetooth subsystem due to asserts being disabled in /subsys/bluetooth/host/hci_core.c
Same weakness CWE-415 – Double Free
View allSame technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-40367