CVE-2026-10653: use-after-free in zephyrproject zephyr
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. This fix is not being backported to v3.7-branch (LTS). The backport was attempted and closed unmerged (#111181): the v3.7 networking tree has diverged from main, and the new atomic word-packing -- together with the assertions it adds -- turns pre-existing v3.7-only reference-counting defects elsewhere in the stack into hard faults, so landing the change faithfully would mean pulling an open-ended set of additional v3.7-only fixes into an LTS branch. v3.7 remains affected. Applications on v3.7 that share one net_buf across threads should serialize their own net_buf_unref() calls rather than rely on the documented self-synchronizing behaviour. The fix is on main and has been backported to v4.3-branch (#110852) and v4.4-branch (#110853).
AI Analysis
Technical Summary
The Zephyr net_buf library manipulates two reference counts (per-header buf->ref and per-data-block ref_count) using non-atomic operations, violating the documented self-synchronizing API. Under concurrent conditions, this can cause two holders to simultaneously believe they hold the last reference, leading to double free of heap blocks or double return of buffers to the pool free list. This results in heap metadata corruption and use-after-free conditions. The vulnerability affects heap/variable-data pools used by various subsystems including zbus, IP stack RX/TX buffers, capture, wireguard, ISO-TP, and usbip, as well as fixed-data pools used by Bluetooth and networking. The fix replaces these reference counts with atomic increment/decrement operations. The fix is applied on main and backported to v4.3 and v4.4 branches but not to the v3.7 LTS branch due to incompatibilities. Applications on v3.7 should serialize net_buf_unref() calls to avoid the race condition.
Potential Impact
This vulnerability can cause heap corruption and use-after-free conditions in Zephyr-based systems under concurrent access to shared net_buf buffers. This may lead to application crashes or memory corruption. The impact requires genuine concurrency and specific application architectures that share buffers across threads. External attackers have limited direct influence over the race condition, reducing the likelihood of remote exploitation. The CVSS score of 6.4 reflects a medium severity with local attack vector, high attack complexity, no privileges required, no user interaction, and low confidentiality and integrity impact but high availability impact.
Mitigation Recommendations
A fix converting reference counts to atomic operations is available on the main branch and backported to Zephyr v4.3 and v4.4 branches. The v3.7 LTS branch remains vulnerable as the fix was not backported due to incompatibilities. Users of v3.7 should serialize net_buf_unref() calls in their applications to avoid concurrent unref races. Check the official Zephyr project advisories and repositories for the latest patches and guidance.
CVE-2026-10653: use-after-free in zephyrproject zephyr
Description
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. This fix is not being backported to v3.7-branch (LTS). The backport was attempted and closed unmerged (#111181): the v3.7 networking tree has diverged from main, and the new atomic word-packing -- together with the assertions it adds -- turns pre-existing v3.7-only reference-counting defects elsewhere in the stack into hard faults, so landing the change faithfully would mean pulling an open-ended set of additional v3.7-only fixes into an LTS branch. v3.7 remains affected. Applications on v3.7 that share one net_buf across threads should serialize their own net_buf_unref() calls rather than rely on the documented self-synchronizing behaviour. The fix is on main and has been backported to v4.3-branch (#110852) and v4.4-branch (#110853).
CVSS v3.1
Score 6.4medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Zephyr net_buf library manipulates two reference counts (per-header buf->ref and per-data-block ref_count) using non-atomic operations, violating the documented self-synchronizing API. Under concurrent conditions, this can cause two holders to simultaneously believe they hold the last reference, leading to double free of heap blocks or double return of buffers to the pool free list. This results in heap metadata corruption and use-after-free conditions. The vulnerability affects heap/variable-data pools used by various subsystems including zbus, IP stack RX/TX buffers, capture, wireguard, ISO-TP, and usbip, as well as fixed-data pools used by Bluetooth and networking. The fix replaces these reference counts with atomic increment/decrement operations. The fix is applied on main and backported to v4.3 and v4.4 branches but not to the v3.7 LTS branch due to incompatibilities. Applications on v3.7 should serialize net_buf_unref() calls to avoid the race condition.
Potential Impact
This vulnerability can cause heap corruption and use-after-free conditions in Zephyr-based systems under concurrent access to shared net_buf buffers. This may lead to application crashes or memory corruption. The impact requires genuine concurrency and specific application architectures that share buffers across threads. External attackers have limited direct influence over the race condition, reducing the likelihood of remote exploitation. The CVSS score of 6.4 reflects a medium severity with local attack vector, high attack complexity, no privileges required, no user interaction, and low confidentiality and integrity impact but high availability impact.
Mitigation Recommendations
A fix converting reference counts to atomic operations is available on the main branch and backported to Zephyr v4.3 and v4.4 branches. The v3.7 LTS branch remains vulnerable as the fix was not backported due to incompatibilities. Users of v3.7 should serialize net_buf_unref() calls in their applications to avoid concurrent unref races. Check the official Zephyr project advisories and repositories for the latest patches and guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- zephyr
- Date Reserved
- 2026-06-02T15:24:26.926Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a43f42f27e9c79719185ebf
Added to database: 06/30/2026, 16:51:59 UTC
Last enriched: 08/07/2026, 13:10:43 UTC
Last updated: 08/15/2026, 00:41:10 UTC
Views: 108
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.