# CVE-2026-12365: Use-after-free in Zephyr delayable work-queue cancellation under SMP timing race

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.8
- **CVSS:** 5.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: Low; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.13% (percentile 1, 2026-11-28)
- **CWE:** CWE-416
- **Published:** 2026-08-14T17:52:05.922Z
- **Modified:** 2026-11-04T04:59:29.374Z

## Who should check

- Anyone running zephyrproject zephyr \>= 2.6.0, \< 4.5.0

## Description

A use-after-free exists in the Zephyr second-generation work queue (kernel/work.c) in the handling of delayable work timeouts. When a delayable work item's timeout has been dequeued and its handler work\_timeout() is in flight (blocked acquiring the work-queue spinlock), a concurrent cancellation does not wait for that handler to finish. In unschedule\_locked() the pre-fix code called z\_abort\_timeout(), which for an already-announcing record returns -EINVAL without removing it; cancel\_async\_locked() then observes the work as idle, so even k\_work\_cancel\_delayable\_sync() and k\_work\_flush\_delayable() return without blocking on the in-flight handler.

Because those are the APIs the kernel header documents as the safe way to cancel before freeing a k\_work\_delayable, a caller that frees the object immediately after a successful sync cancel can race the still-pending handler. work\_timeout() subsequently dereferences the freed record: it reads to-\>dticks via z\_is\_timeout\_handler\_canceled() and, if the freed slot has been reused so the bail check fails, performs a read-modify-write of wp-\>flags (K\_WORK\_DELAYED\_BIT) and submits work against a stale dw-\>queue pointer — a use-after-free read and write.

The k\_work API is kernel-mode only (no \_\_syscall entry point), so this is a kernel-internal concurrency defect rather than a userspace privilege escalation. Triggering it requires an SMP build and a subsystem that schedules and then frees (or reschedules) a delayable work item in the narrow window while its timeout is announcing; an attacker able to influence the timing of such teardown (for example via connection churn driving subsystem timers) has a plausible but probabilistic path. The impact is kernel memory corruption or crash (denial of service).

The fix makes unschedule\_locked() wait, by spinning on z\_try\_abort\_timeout() returning -EAGAIN while releasing and re-acquiring the work spinlock, until any in-flight handler completes before returning, and switches work\_timeout() to atomic K\_WORK\_DELAYED\_BIT ownership. This closes both the free-then-handler use-after-free and the related reschedule early-fire race.

## Affected and fixed versions

- zephyrproject zephyr: \>= 2.6.0, \< 4.5.0 (cvelist)

## Mitigation

- Upgrade zephyr to 4.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-12365. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-12365.md
Affected: zephyrproject zephyr >= 2.6.0, < 4.5.0
Fixed in: zephyrproject zephyr 4.5.0

Steps:
1. Search this machine and project for zephyrproject zephyr: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-12365 being exploited?

There is no confirmed exploitation: CVE-2026-12365 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.13% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-12365?

Medium: CVSS 5.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

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

zephyrproject zephyr \>= 2.6.0, \< 4.5.0.

### Is there a fix for CVE-2026-12365?

Yes. Fixed in zephyrproject zephyr 4.5.0. Upgrade zephyr to 4.5.0 or later.

### How do I check if I'm affected by CVE-2026-12365?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-rhmh-r93p-6g99>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/59cf34bf212eeb5c7ea88b97e15842b1e7c1a6b7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-12365>

HTML: <https://flawdb.com/CVE-2026-12365> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-12365>
