Zephyr kernel memory corruption in thread and stack objects
Affects Zephyr from 1.12.0 onward, only in builds with CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS enabled. No fixed version is listed in the checked facts.
- Exploited
- No known exploitation
- Fix
- See vendor advisory
- Who is exposed
- Specific setups only
Summary
Zephyr's kernel user-mode object management can free thread and stack objects while the kernel is still using them, a use-after-free bug. A local user with low privileges and no user interaction can trigger it through system calls from a user thread that has a resource pool, which can compromise confidentiality, integrity, and availability.
Written by a model
Original description
In the kernel's user-mode object management, unref_check() in kernel/userspace/userspace.c frees a dynamically allocated kernel object as soon as its permission bitmap becomes empty. It does not check the object type or whether the kernel still uses the object. k_thread_create() keeps pointers to a dynamic struct k_thread (from k_object_alloc(K_OBJ_THREAD)) and a dynamic stack (from k_object_alloc_size(K_OBJ_THREAD_STACK_ELEMENT, ...) or k_thread_stack_alloc() with K_USER) for the whole life of the thread, but nothing in the bitmap records this. z_thread_user_init() gives the new thread permission on its own thread object only, not on its stack. When the thread terminates, halt_thread() calls z_thread_release(), and its z_thread_user_exit() drops all of the thread's permissions. If that leaves the bitmap empty, the thread's own struct k_thread (and a stack it holds the last permission on) is freed before the abort path and the context switch are done with it.
Any user thread with a resource pool can trigger this through syscalls it is allowed to make. If it creates a thread on a dynamic stack and then calls k_object_release() on the stack, or exits, the stack block is freed while the child still runs on it. With CONFIG_GEN_PRIV_STACKS that block also holds the privileged stack and z_stack_data, and the child keeps user-mode access to it. Once the creator has released a dynamic thread object, the thread itself can call k_object_release() on its own thread object and free its struct k_thread while it is running. z_vrfy_k_object_release() checks only that the caller holds permission on the object. If the creator has dropped its permissions, the child's ordinary termination frees the thread object inside halt_thread(). The kernel then still reads and writes the freed memory: thread->stack_obj, the thread state, swap_retval and switch_handle, and CPUs waiting for the halt spin on it. On SMP builds, another CPU can reallocate the memory in that window. All of this needs CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS.
Freed blocks go back to the thread's resource pool, which also serves later kernel allocations such as other dynamic kernel objects and their metadata. A user thread can then read and write kernel heap memory it was never granted, overwrite kernel data later placed there, or control the contents of a struct k_thread that the scheduler still uses. This breaks kernel integrity (P1) and user-mode isolation (P2) from an unprivileged user thread. The supervisor-only k_object_free() states that it is not exposed to user mode because the kernel cannot tell whether an object is still in use, and k_thread_stack_free() refuses to free a stack in use. Dropping permissions gets around both.
Who should check
Teams building Zephyr 1.12.0 or later with CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS enabled, where user threads create threads on dynamic stacks or objects.
“All of this needs CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS”
What to do
Check whether your setup matches what the bug needs.
Requires CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS Attacker needs a user thread that has a resource pool Affected since Zephyr 1.12.0Workaround: The checked facts give no workaround. The bug requires both CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS, so those are the settings to review while waiting for a fix.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-130477 (Kernel user mode: dynamic thread and stack objects can be freed while their thread is still running or exiting (use-after-free)), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-130477 (entry last updated 2026-11-29):
Affected:
- zephyrproject zephyr: from 1.12.0
Fixed versions: none listed yet.
Conditions (all must be true for the bug to be hit):
- Requires CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS (source: https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-624h-x2xx-2h3w)
- Attacker needs a user thread that has a resource pool (source: https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-624h-x2xx-2h3w)
- Affected since Zephyr 1.12.0 (source: https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-624h-x2xx-2h3w)
Setup: the bug needs a feature or setting that is off by default or uncommon. Check whether each asset has it on.
Attacker needs: local access, low-privilege login, no user action.
CISA KEV: CVE-2026-130477 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-130477 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-624h-x2xx-2h3w
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-130477
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-130477"}.Affected versions
- zephyrFrom 1.12.0
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure5/25Specific setups only
- Reach?/20Unknown. No tracked technology or package matched
- Severity8.8/10CVSS 8.8
- No patch5/5No fixed version listed; see vendor advisory
What would change the score
- Would score about 69 if added to CISA KEV
- Would score about 64 if CISA's SSVC rates exploitation active
- Would score about 29 if CISA's SSVC rates it automatable
Timeline
- CVE published
- First seen by cve.now
Evidence 3
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · zephyrproject-rtos/zephyr · Advisory GHSA-624h-x2xx-2h3w |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-130477 |
| Record | NVD · CVE-2026-130477 |
Questions about CVE-2026-130477
Is CVE-2026-130477 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
Dynamic thread and stack objects can be freed while their thread is still running or exiting, which is a use-after-free. A user thread can then read and write kernel heap memory it was never granted, overwrite kernel data, and control a struct k_thread used by the scheduler.
Source: github.com
Which versions are affected by CVE-2026-130477?
zephyr: from 1.12.0.
Source: cve.now feed data
Am I affected, and how do I check?
The checked facts list Zephyr from 1.12.0 onward. The bug needs CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS, and a user thread that has a resource pool. You can check the build configuration for these two options and the Zephyr version in use.
Source: github.com
How do I fix CVE-2026-130477?
The checked facts name no fixed version and no vendor patch IDs, so no upgrade target can be given from them. Check the Zephyr project's advisory for a fix before deciding on an upgrade.
Source: github.com
What if there's no patch?
The checked facts give no workaround. The bug requires both CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS, so those are the settings to review while waiting for a fix.
Source: github.com
Related
- CVE-2026-104378Out-of-bounds write in DesignWare I3C driver direct CCC handling via unbounded target count
- CVE-2026-100374Missing user buffer validation in SMBus block read and block process call syscalls allows kernel memory writes
- CVE-2026-104376Use-after-free write through dangling object-core list node in Zephyr kernel obj_core
- CVE-2026-102957PWM capture syscall leaves callback armed on a dead kernel stack frame when called with K_NO_WAIT
- CVE-2026-105415Out-of-bounds write via unchecked channel index in ESP32 MCPWM PWM driver set_cycles syscall
- CVE-2026-102960Stack buffer overflow in Grow R502-A fingerprint sensor driver UART RX handler
No corrections so far. Something wrong on this page? Report an error.