CVE-2026-12366
Received Received - Intake

Use-After-Free in Zephyr RTOS Kernel Timer Object

Vulnerability report for CVE-2026-12366, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-14

Last updated on: 2026-08-14

Assigner: Zephyr Project

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-14
Last Modified
2026-08-14
Generated
2026-08-14
AI Q&A
2026-08-14
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr From 1.12.0 (inc) to 4.4.2 (inc)
zephyrproject zephyr to 4.4.2 (inc)
zephyr_project zephyr From 3.0.0 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-416 The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a use-after-free vulnerability in the Zephyr RTOS kernel where dynamically allocated timers are freed without properly cancelling pending timeouts. When a timer's reference count drops to zero, its memory is freed but the timeout queue retains a dangling reference. Later, when the timeout expires, the kernel's handler dereferences freed memory, causing a use-after-free condition.

Impact Analysis

An unprivileged user thread can exploit this to trigger memory corruption, unexpected timer callbacks, or denial of service. The vulnerability allows privilege escalation since the free and expiration handler run at kernel privilege while the actor is a user thread.

Mitigation Strategies

Apply the official patch from Zephyr's GitHub repository that introduces k_timer_cleanup() to properly handle timer disposal. Ensure CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are disabled if not required. Monitor kernel logs for unexpected timer expirations or memory corruption events.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-12366. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart