# CVE-2026-11742: Use-after-free race in kernel `k_queue_peek_head/tail` due to missing spinlock

> A race condition in Zephyr kernel queue peeking allows use-after-free, potentially leaking heap data or crashing the system via dangling pointers.

- **Severity:** Low 3.6 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 7 Aug 2026
- **Updated:** 10 Aug 2026
- **Also known as:** GHSA-8xm3-4w69-29mm

## What is CVE-2026-11742?

CVE-2026-11742 is a low-severity use after free vulnerability in zephyrproject zephyr, published on 7 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The kernel queue helper z_queue_node_peek() in kernel/queue.c dereferences a node taken from a queue's data_q list, reading the node's flag byte and, for items enqueued via k_queue_alloc_append/alloc_prepend, the data pointer of an internally allocated alloc_node struct. The implementations of z_impl_k_queue_peek_head() and z_impl_k_queue_peek_tail() performed this read-and-dereference without holding the queue's spinlock, while every other accessor of the same list — including k_queue_get(), which unlinks a node and k_free()s its backing alloc_node — operates under that lock.

Because peek was unsynchronized, a concurrent k_queue_get() on the same queue (on an SMP build, or under preemption/ISR concurrency) can free the node between the moment peek obtains the node pointer and the moment it dereferences it. The peek then reads flag bits and a data pointer out of freed, potentially re-allocated heap memory and returns a stale or dangling pointer to its caller. k_fifo and k_lifo are thin wrappers over k_queue, so this affects buffer queues used throughout the net_buf, Bluetooth, USB, and networking subsystems; the peek operations are also system calls reachable from CONFIG_USERSPACE threads.

The consequences are a use-after-free read that can leak stale heap contents (one pointer word) and, when the returned dangling pointer is subsequently consumed as a live buffer, a dereference that can crash the system or corrupt memory. Exploitation requires winning a small race window with local access (e.g. a userspace process racing k_queue_peek_* against k_queue_get on a shared queue, or two CPUs), so practical impact is bounded and of low severity.

The fix wraps both peek implementations with k_spin_lock/k_spin_unlock on the queue lock, making the read-and-dereference atomic with respect to the concurrent unlink-and-free and bringing peek into line with the rest of the queue's locking discipline.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2026-11742?


## How do I fix CVE-2026-11742?

No fix has been published for CVE-2026-11742 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-11742 being exploited?

There is no known exploitation of CVE-2026-11742 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-11742 and fix it if it is affected.

What it is: CVE-2026-11742 is a low-severity use after free vulnerability in zephyrproject zephyr, published on 7 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-11742 in the wild and no public exploit code.

Affected product: zephyrproject zephyr. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-11742/ (Markdown: https://insights.sbomify.com/CVE-2026-11742/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-11742
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-11742
- OSV: https://osv.dev/vulnerability/CVE-2026-11742

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-11742/
Summaries are generated and may contain mistakes; the official description above is the record.
