CVE-2026-87038
Awaiting Analysis Awaiting Analysis - Queue

Race Condition in Zephyr RTOS I3C Subsystem Enables Privilege Escalation

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

Publication date: 2026-11-04

Last updated on: 2026-11-04

Assigner: Zephyr Project

Description

The user-mode verification handler for the i3c_transfer() system call, z_vrfy_i3c_transfer() in drivers/i3c/i3c_handlers.c, validated the caller-supplied struct i3c_device_desc in place instead of snapshotting it. It confirmed only that the descriptor was readable by the calling thread (K_SYSCALL_MEMORY_READ()), read target->bus once to check it with K_SYSCALL_OBJ(), and then passed the caller's live pointer down. The implementation z_impl_i3c_transfer() re-reads target->bus from that user memory and dispatches through it as DEVICE_API_GET(i3c, target->bus)->i3c_xfers(...), so the bus that was validated is not necessarily the bus that is used. DEVICE_API_GET() performs no runtime type check outside CONFIG_DEVICE_API_ASSERT builds. On a build with CONFIG_USERSPACE and an I3C controller driver, a user thread that has been granted an I3C device object can exploit this with a second thread in the same memory domain: one thread calls i3c_transfer() while the other rewrites the bus field of the descriptor. The window between the check and the use spans the num_msgs validation, the message-array access check, a stack VLA allocation and a memcpy() of up to 32 struct i3c_msg, so the race is repeatable and can simply be retried until it lands. When the substitution succeeds, the kernel dereferences an attacker-chosen pointer as a struct device, loads a function pointer from the attacker-controlled api table and calls it in supervisor mode with attacker-influenced arguments. This yields kernel-mode code execution from an unprivileged user thread β€” a complete escape of the userspace memory-protection sandbox; lesser outcomes are an arbitrary two-level kernel read or a kernel fault. Builds without CONFIG_USERSPACE, or without an I3C driver, are unaffected. The fix copies the descriptor into a kernel-stack local with k_usermode_from_copy(), validates the bus in that copy, and dispatches on the copy, so the validated value is provably the value used.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

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

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr 3.2.0
zephyrproject zephyr 4.4.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-367 The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a time-of-check/time-of-use (TOCTOU) race condition in Zephyr RTOS's i3c_transfer() system call handler. The vulnerability occurs because the verification function validates the i3c_device_desc structure in place without creating a snapshot. It checks memory readability and the bus object but doesn't prevent another thread from modifying the bus field between validation and use. The implementation later re-reads the bus field from user memory, which can be changed by an attacker-controlled thread. This allows an unprivileged user to escalate privileges to kernel mode by executing attacker-chosen code in supervisor mode.

Detection Guidance

Detecting this vulnerability requires checking Zephyr RTOS versions and I3C driver configurations. Use commands like 'git log --oneline --grep="i3c_transfer"' or 'grep -r "CONFIG_I3C" .config' to verify if affected versions are present. Ensure CONFIG_USERSPACE and I3C driver are enabled.

Impact Analysis

An attacker with access to a system running vulnerable Zephyr RTOS versions could exploit this to escape the userspace memory-protection sandbox and gain kernel-mode code execution. This could allow complete system compromise, including arbitrary kernel memory reads or writes, denial of service through kernel faults, or installation of persistent malware. The attack requires local access and a specific configuration (CONFIG_USERSPACE enabled with an I3C controller driver).

Compliance Impact

This vulnerability could lead to unauthorized system access, data breaches, or privilege escalation attacks. For GDPR, it may violate requirements for protecting personal data and implementing appropriate security measures. For HIPAA, it could compromise protected health information by allowing unauthorized access to systems handling sensitive data. Organizations using vulnerable Zephyr RTOS versions may face compliance violations and potential regulatory penalties.

Mitigation Strategies

Immediately update Zephyr RTOS to versions 4.3.2, 4.5.0, or later. Disable CONFIG_USERSPACE if not required or disable the I3C driver if unused. Apply the patch from commit 550437bc9efd7b733f13b9be73e77fd98858c8a2 if source updates are not feasible.

Chat Assistant

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

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...