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.
{
"cna_assigner": "zephyr",
"cwe_ids": [
"CWE-416"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/12xxx/CVE-2026-12366.json",
"unresolved_ranges": [
{
"extracted_events": [
{
"introduced": "1.12.0"
},
{
"fixed": "4.5.0"
}
],
"source": "AFFECTED_FIELD"
}
]
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-12366.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"305372532874423663323853162842112310374",
"252376666975425737421398210485255638256",
"94250708667622103004959162046545780205"
],
"threshold": 0.9
},
"id": "CVE-2026-12366-0cac8b71",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2",
"target": {
"file": "include/zephyr/kernel.h"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "88338090246189053074029519582163133673",
"length": 867
},
"id": "CVE-2026-12366-5ed6dbc3",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2",
"target": {
"file": "kernel/userspace/userspace.c",
"function": "unref_check"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"66233332495324426984087179552357069164",
"137854425998483445233205699968855929803",
"148961134059924129739724131289783074742",
"59557773175400766270179314583952837584",
"72271290741663998443212752614892931944",
"290591764069872232127901526394104043573"
],
"threshold": 0.9
},
"id": "CVE-2026-12366-81eddb08",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2",
"target": {
"file": "kernel/timer.c"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"175848409453815881175249465133628789321",
"89739579097572703829270834045985009210",
"326071191205111743708386828232415666356",
"273044645211350846033584871890401335473"
],
"threshold": 0.9
},
"id": "CVE-2026-12366-84fd36ae",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/1e68351a2572f9ae480be71da4aca9aa90db3fb2",
"target": {
"file": "kernel/userspace/userspace.c"
}
}
]
"2026-08-28T14:32:53Z"