Severity by source
AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
AV:L because exploitation requires local user-thread code execution; PR:L because an unprivileged Zephyr thread suffices; S:C because exploitation escalates to full kernel-privilege memory writes.
Primary rating from Vendor (zephyrproject).
CVSS VectorVendor: zephyrproject
Lifecycle Timeline
4DescriptionCVE.org
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.
AnalysisAI
Privilege escalation via a deterministic use-after-free in Zephyr RTOS's dynamic kernel-object disposal path affects any firmware build compiled with both CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS enabled. An unprivileged user thread can arm a dynamically-allocated k_timer, then release its last permission - causing unref_check() to free the timer's backing storage while the embedded struct _timeout dnode remains linked in the global _timeout_q; when the timer subsequently fires, z_timer_expiration_handler() dereferences and writes the freed - and potentially reallocated - kernel heap at ISR privilege. The bug constitutes a reliable sandbox-escape memory-corruption primitive scored CVSS 8.8 with scope change (S:C), and no public exploit has been identified at time of analysis.
Technical ContextAI
Zephyr RTOS implements a privilege-separated userspace model (CONFIG_USERSPACE) combined with a dynamic kernel-object allocator (CONFIG_DYNAMIC_OBJECTS) that tracks per-object reference counts in unref_check() within kernel/userspace/userspace.c. When a reference count drops to zero, unref_check() executes a per-type cleanup switch before calling k_free(dyn->data). The original switch covered K_OBJ_MSGQ and K_OBJ_STACK but contained no K_OBJ_TIMER case. A k_timer embeds a struct _timeout dnode that is physically linked into the global timeout queue _timeout_q via a doubly-linked list whenever the timer is armed with k_timer_start(). The missing cleanup case meant that freeing a running timer skipped timeout cancellation entirely, leaving a dangling pointer in _timeout_q to now-freed kernel heap. The root cause is CWE-416 (Use After Free): when the timeout period elapses, the kernel's timeout machinery walks _timeout_q and invokes z_timer_expiration_handler() on the freed node, reading and writing arbitrary freed storage at kernel/ISR privilege. Critically, this is deterministic - no SMP race or timing window is required, only the sequence of arm-then-release. The fix in commit 1e68351a2572f9ae480be71da4aca9aa90db3fb2 introduces k_timer_cleanup(), which cancels the timeout via z_try_abort_timeout() under a spinlock and spins until any in-flight expiration handler on another CPU completes before returning. A new K_OBJ_TIMER case in unref_check() calls k_timer_cleanup() (guarded by K_OBJ_FLAG_INITIALIZED to avoid reading garbage from an uninitialized dnode) prior to freeing storage.
RemediationAI
The primary remediation is to apply commit 1e68351a2572f9ae480be71da4aca9aa90db3fb2 (https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2) or to upgrade to a tagged Zephyr release confirmed to include this commit; the exact first patched release version is not specified in the available data and must be verified via GHSA-x96g-542c-gccq before treating any specific tag as safe. If an immediate rebuild is not possible, the most targeted compensating control is to disable CONFIG_DYNAMIC_OBJECTS at build time, which removes the dynamic object disposal path entirely and eliminates the vulnerable code; the trade-off is that all applications relying on runtime kernel-object allocation must be refactored to use statically defined objects. Disabling CONFIG_USERSPACE is a broader alternative that eliminates the unprivileged attack surface entirely but removes the userspace isolation model, which may be architecturally unacceptable for products that use sandboxing as a security boundary. Both workarounds require a full firmware rebuild and redeployment, making patch application the preferred path wherever feasible.
Same weakness CWE-416 – Use After Free
View allSame technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-58752