CVE Professor
/
All CVEs
CVE-2026-104376

CVE-2026-104376 — Zephyrproject Zephyr — CWE-416

HIGH CVSS 7.7 ⚡ EPSS 0.3% NVD

The kernel object core framework (kernel/obj_core.c) linked every participating kernel object (semaphores, mutexes, message queues, stacks, pipes, events, and so on) into a per-type singly linked list through a sys_snode_t embedded in the object itself. k_obj_core_link() appended the object with sys_slist_append(), and nothing ever unlinked these objects except threads. When an object's storage was freed, went out of scope, or was reused while it was the list tail, the list kept pointing into dead memory. The next k_obj_core_init_and_link() (for example from k_sem_init()) then wrote a pointer through that stale node. Re-initializing the current tail object also made the list self-referential, so k_obj_type_walk_locked() / k_obj_type_walk_unlocked() loop forever. When CONFIG_OBJ_CORE, CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are all enabled, an unprivileged user-mode thread can trigger this through system calls alone. It allocates a semaphore with k_object_alloc(), initializes it with k_sem_init(), and releases it with k_object_release(). unref_check() then frees the object without unlinking it, and the thread's next k_sem_init() makes the kernel write a kernel pointer into the freed (and possibly reallocated) kernel heap chunk. In kernel-only builds with CONFIG_OBJ_CORE enabled, the same defect corrupts memory during ordinary operation, because k_work_flush() and k_work_cancel_sync() initialize semaphores on the caller's stack. The result is supervisor-mode memory corruption that crosses the userspace isolation boundary. It can crash the system, corrupt unrelated kernel objects that reuse the freed memory, or hang any walker of the object-core lists. CONFIG_OBJ_CORE is disabled by default. The fix replaces the intrusive lists with a kernel-owned registry keyed by object address, so the code no longer writes into registered objects' storage.

The kernel object core framework (kernel/obj_core.c) linked every participating kernel object (semaphores, mutexes, message queues, stacks, pipes, events, and so on) into a per-type singly linked list through a sys_snode_t embedded in the object itself. k_obj_core_link() appended the object with sys_slist_append(), and nothing ever unlinked these objects except threads. When an object's storage was freed, went out of scope, or was reused while it was the list tail, the list kept pointing into dead memory. The next k_obj_core_init_and_link() (for example from k_sem_init()) then wrote a pointer through that stale node. Re-initializing the current tail object also made the list self-referential, so k_obj_type_walk_locked() / k_obj_type_walk_unlocked() loop forever. When CONFIG_OBJ_CORE, CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are all enabled, an unprivileged user-mode thread can trigger this through system calls alone. It allocates a semaphore with k_object_alloc(), initializes it with k_sem_init(), and releases it with k_object_release(). unref_check() then frees the object without unlinking it, and the thread's next k_sem_init() makes the kernel write a kernel pointer into the freed (and possibly reallocated) kernel heap chunk. In kernel-only builds with CONFIG_OBJ_CORE enabled, the same defect corrupts memory during ordinary operation, because k_work_flush() and k_work_cancel_sync() initialize semaphores on the caller's stack. The result is supervisor-mode memory corruption that crosses the userspace isolation boundary. It can crash the system, corrupt unrelated kernel objects that reuse the freed memory, or hang any walker of the object-core lists. CONFIG_OBJ_CORE is disabled by default. The fix replaces the intrusive lists with a kernel-owned registry keyed by object address, so the code no longer writes into registered objects' storage.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H
Attack Vector Local AV:L
Attack Complexity High AC:H
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Changed S:C
Confidentiality Low C:L
Integrity High I:H
Availability High A:H
EPSS — Exploit Prediction Scoring System
0.3%
30-day probability
In the 11. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE-2026-104376 is a Use-After-Free (UAF) vulnerability (CWE-416) in the Zephyr RTOS kernel's object core framework (kernel/obj_core.c).

The root cause lies in the design of the kernel object registry. The framework maintains per-type singly linked lists (e.g., for semaphores, mutexes, message queues) to allow the kernel to iterate over all active objects of a specific type. This is achieved by embedding a sys_snode_t structure directly within the memory allocation of each kernel object.

The Flaw:
1. Intrusive List Design: When an object is initialized (e.g., via k_sem_init()), it is appended to the global list for its type using sys_slist_append().
2. Missing Unlink on Free: When the object's memory is freed (via k_object_release() or stack scope exit), the code fails to remove the node from the linked list.
3. Stale Pointer: The list tail (or any node in the chain) now points to memory that has been returned to the heap allocator.
4. Heap Reuse & Corruption: If that memory chunk is reallocated for a new object (or reused by another subsystem), the next call to k_obj_core_init_and_link() will write a pointer into the stale node location. Since the stale node is still part of the active list, this write corrupts the kernel's internal data structures.
5. Self-Reference Loop: Re-initializing the object that is currently the tail of the list can cause the list to become self-referential, leading to infinite loops in k_obj_type_walk_locked().

Critical Context:

  • This vulnerability is only exploitable when CONFIG_OBJ_CORE, CONFIG_USERSPACE, and CONFIG_DYNAMIC_OBJECTS are enabled.

  • CONFIG_OBJ_CORE is disabled by default in standard Zephyr builds.

  • The vulnerability allows an unprivileged user-mode thread to corrupt supervisor-mode (kernel) memory, breaking the isolation boundary.
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Target Identification: The attacker must identify a Zephyr-based device (IoT, embedded sensor, etc.) that has:
  • * CONFIG_USERSPACE enabled (allowing unprivileged threads). * CONFIG_DYNAMIC_OBJECTS enabled (allowing runtime allocation of kernel objects). * CONFIG_OBJ_CORE enabled (the vulnerable framework).
  • Version Check: Determine the Zephyr version. Since this is a recent CVE (2026), it likely affects versions prior to the patch that introduced the kernel-owned registry.
  • Attack Surface: The attacker needs a valid user-mode thread or the ability to execute code in user mode. This could be via a legitimate application, a compromised peripheral, or a local physical access scenario.
  • 2. Exploitation

    The attacker exploits the UAF by triggering a specific sequence of system calls to free an object while it remains in the kernel's linked list, then reusing the memory.

    Illustrative PoC (C Code for Zephyr User-Mode Thread):
    Note: This is a conceptual PoC demonstrating the logic. Exact function signatures may vary slightly by Zephyr version.

    #include <zephyr/kernel.h>
    #include <zephyr/sys/cbprintf.h>
    
    // Assume these are available in the user-mode environment
    extern void *k_object_alloc(size_t size);
    extern void k_object_release(void *obj);
    extern int k_sem_init(struct k_sem *sem, unsigned int initial, unsigned int limit);
    
    void exploit_uaf(void) {
        // 1. Allocate a semaphore object dynamically
        struct k_sem *sem = (struct k_sem *)k_object_alloc(sizeof(struct k_sem));
        if (!sem) {
            printk("Allocation failed\n");
            return;
        }
    
        // 2. Initialize the semaphore. This links it into the kernel's 
        //    semaphore list via k_obj_core_init_and_link().
        k_sem_init(sem, 0, 1);
    
        // 3. Release the object. 
        //    CRITICAL: This frees the memory but DOES NOT unlink it from the list.
        //    The kernel's list now points to freed memory.
        k_object_release(sem);
    
        // 4. Trigger memory reuse.
        //    The attacker allocates a new object of the same size.
        //    The heap allocator is likely to return the same chunk.
        struct k_sem *new_sem = (struct k_sem *)k_object_alloc(sizeof(struct k_sem));
        
        if (new_sem) {
            // 5. Initialize the new semaphore.
            //    This calls k_obj_core_init_and_link() again.
            //    It writes a pointer into the 'stale node' location (which is now 
            //    part of new_sem's memory).
            //    This corrupts the kernel's linked list structure.
            k_sem_init(new_sem, 0, 1);
            
            // 6. The kernel's object list is now corrupted.
            //    Subsequent calls to k_obj_type_walk() may crash or loop infinitely.
            //    If the corrupted pointer is dereferenced, it may lead to 
            //    arbitrary kernel memory write or code execution.
        }
    }

    Mechanism of Corruption:
    1. k_object_release(sem) frees the memory chunk.
    2. The kernel's semaphore list still contains a node pointing to this freed chunk.
    3. k_object_alloc() returns the same chunk for new_sem.
    4. k_sem_init(new_sem, ...) writes the sys_snode_t structure into new_sem's memory.
    5. Because the old node is still in the list, the kernel now has a list node that points to new_sem's internal structure, but the list's internal pointers are inconsistent with the new object's state.
    6. If the kernel walks the list, it may follow a pointer that is now invalid or points to a different object, leading to:
    * Crash: Dereferencing a bad pointer.
    * Infinite Loop: If the list becomes self-referential.
    * Arbitrary Write: If the attacker can control the contents of the reused memory, they may be able to overwrite kernel function pointers or other critical structures.

    3. Post-Exploitation

  • Denial of Service (DoS): The most likely outcome is a kernel panic or infinite loop, crashing the device. This is a high-impact availability issue.
  • Privilege Escalation: If the attacker can control the contents of the reused memory chunk, they may be able to overwrite kernel function pointers (e.g., in a work queue or interrupt handler) to redirect execution to user-mode code. This would allow the unprivileged thread to execute arbitrary code in supervisor mode, effectively gaining full control of the device.
  • Data Exfiltration: By corrupting kernel memory, the attacker may be able to read sensitive data (e.g., cryptographic keys, network buffers) that resides in adjacent memory regions.
  • 🌍 Real World Impact

    CVSS Vector Analysis: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H

  • Attack Vector (AV:L): Local access is required. The attacker must have a user-mode thread or local physical access to the device.
  • Attack Complexity (AC:H): High complexity. The attacker must precisely control the heap layout to ensure the freed memory is reused for a new object of the same type and size. This requires knowledge of the heap allocator's behavior and may require multiple attempts.
  • Privileges Required (PR:L): Low privileges. An unprivileged user-mode thread is sufficient.
  • User Interaction (UI:N): No user interaction required.
  • Scope (S:C): Changed. The vulnerability allows an unprivileged user-mode thread to corrupt supervisor-mode (kernel) memory, crossing the security boundary.
  • Confidentiality (C:L): Low. The attacker may be able to read some kernel memory, but direct access to all sensitive data is not guaranteed.
  • Integrity (I:H): High. The attacker can corrupt kernel data structures, potentially leading to arbitrary code execution.
  • Availability (A:H): High. The most likely outcome is a system crash or hang.
  • Practical Consequences:

  • IoT Devices: Many IoT devices run Zephyr with user-mode enabled for security. A compromised peripheral or application could crash the device, leading to service disruption.

  • Industrial Control Systems (ICS): If Zephyr is used in ICS, a crash could lead to safety hazards or production downtime.

  • Security Boundary Breach: The ability to corrupt kernel memory from user mode is a severe security flaw, as it undermines the fundamental isolation provided by the Zephyr security model.
  • 🛡️ Remediation & Mitigation

    1. Patching

  • Upgrade: Upgrade to a version of Zephyr that includes the fix. The fix replaces the intrusive linked lists with a kernel-owned registry keyed by object address. This ensures that the kernel does not write into the object's storage, eliminating the UAF.
  • Check Zephyr Release Notes: Look for a commit or release note mentioning "obj_core" or "object core framework" fixes.
  • 2. Workarounds

  • Disable CONFIG_OBJ_CORE: Since CONFIG_OBJ_CORE is disabled by default, ensure it remains disabled if not strictly necessary. This is the most effective mitigation.
  • CONFIG_OBJ_CORE=n
  • Disable CONFIG_DYNAMIC_OBJECTS: If dynamic allocation of kernel objects is not required, disable this option. This prevents the attacker from allocating and freeing objects at runtime.
  • CONFIG_DYNAMIC_OBJECTS=n
  • Disable CONFIG_USERSPACE: If user-mode isolation is not required, disable user mode. This prevents unprivileged threads from triggering the vulnerability.
  • CONFIG_USERSPACE=n

    3. Detection

  • Kernel Logs: Look for kernel panics, assertion failures, or infinite loops in k_obj_type_walk().
  • * Example log: ASSERTION FAIL: node != NULL IN: /zephyr/kernel/obj_core.c * Example log: System halted: Infinite loop detected in object walk
  • Heap Corruption: Monitor for unexpected heap corruption errors or memory allocation failures.
  • Crash Dumps: Analyze crash dumps for signs of corrupted linked list pointers or invalid memory accesses in obj_core.c.
  • ⚠️ Urgency

    Priority: Medium-High

  • CVSS Score: 7.7 (High)
  • CISA KEV: No (Not currently exploited in the wild)
  • Exploit Complexity: High (Requires precise heap control)
  • Default Configuration: CONFIG_OBJ_CORE is disabled by default, which significantly reduces the attack surface.
Recommendation: 1. Immediate: Audit your Zephyr configurations. If CONFIG_OBJ_CORE is enabled, treat this as a high-priority issue. 2. Short-Term: Disable CONFIG_OBJ_CORE if it is not required. 3. Long-Term: Upgrade to a patched version of Zephyr.

Note: While the exploit complexity is high, the impact is severe (kernel memory corruption, potential RCE). In critical environments (ICS, medical devices), this should be treated as a high-priority vulnerability.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="zephyrproject Zephyr"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-104376
Technical reference / advisory repository for CVE-2026-104376
CVSS Score
7.7 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-416
Affected Products (1)
zephyrproject:Zephyr
References & Advisories (2)
Related CVEs
7.0
CVE-2026-86092
The user-mode verifier for the I2S configure system call, z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c
6.5
CVE-2026-145059
FreeRDP from 3.25.0 before 3.33.1 contains a use-after-free in the RDPEWA client because notifyWait does not j
6.3
CVE-2026-144771
A flaw has been found in SGLang up to 0.5.23. The affected element is the function try_match_prefix of the fil
5.8
CVE-2026-144210
In Eclipse Safe Open Vehicle Core (S-CORE) Kyron versions 0.0.3 through 0.2.0, `SpmcStealQueue::fetch_from` in
4.1
CVE-2026-119604
IBM PowerVM VIOS 4.1 could allow a local attacker to cause a denial of service due to a use-after-free race c
9.5
CVE-2026-138715
A use-after-free vulnerability in WatchGuard Endpoint Security's POP3 traffic parser allows a remote, unauthen
9.5
CVE-2026-138721
A use-after-free vulnerability exists in WatchGuard Endpoint Security's rules translation component, where a c