# CVE-2026-12366: Use-after-free freeing an armed dynamically-allocated k\_timer in Zephyr userspace object disposal

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

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; 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.17% (percentile 3, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2026-08-14T17:52:07.021Z
- **Modified:** 2026-11-04T04:59:26.531Z

## Who should check

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

## Description

Zephyr's dynamic kernel-object disposal path unref\_check() in kernel/userspace/userspace.c frees an object's storage (k\_free(dyn-\>data)) once its reference count reaches zero, after running a per-object-type cleanup. The cleanup switch handled only K\_OBJ\_MSGQ and K\_OBJ\_STACK; there was no K\_OBJ\_TIMER case. A dynamically-allocated, initialized, and armed k\_timer keeps its embedded struct \_timeout dnode linked in the global timeout queue (\_timeout\_q), so freeing the timer storage without cancelling the timeout leaves a dangling node in that queue.

When the timer next expires, the timeout machinery walks \_timeout\_q and invokes z\_timer\_expiration\_handler() on the freed node, dereferencing and writing freed (and reusable) kernel heap in kernel/ISR context. This is a deterministic use-after-free that does not depend on SMP: the queued node is simply never unlinked at free time.

The disposal is reachable from an unprivileged user thread under CONFIG\_USERSPACE + CONFIG\_DYNAMIC\_OBJECTS: a thread that holds the last permission on such a timer drops it via the k\_object\_release() syscall (or by exiting, through k\_thread\_perms\_all\_clear()), and can arm the timer itself via the k\_timer\_start() syscall. The free and the expiration handler run at kernel privilege while the actor is a user thread, so the bug is a sandbox-escape memory-corruption primitive usable for privilege escalation. The fix adds k\_timer\_cleanup() (cancel the timeout and wait for any in-flight handler) and calls it for K\_OBJ\_TIMER before freeing.

## Affected and fixed versions

- zephyrproject zephyr: \>= 1.12.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-12366. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-12366.md
Affected: zephyrproject zephyr >= 1.12.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-12366 being exploited?

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

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

High: CVSS 8.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

zephyrproject zephyr \>= 1.12.0, \< 4.5.0.

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

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-12366?

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-x96g-542c-gccq>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2>

## 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-12366>

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