CVE-2026-9771: memory-safety in zephyrproject zephyr
The flash_copy() system call is verified by z_vrfy_flash_copy() in drivers/flash/flash_util.c. On builds with CONFIG_USERSPACE enabled, this handler is the kernel-side trust boundary for a user-mode caller. Prior to the fix it validated only the output buffer (K_SYSCALL_MEMORY_WRITE) and passed the two struct device * arguments, src_dev and dst_dev, directly into the implementation without any object validation — unlike every sibling flash syscall, which guards its device pointer with K_SYSCALL_DRIVER_FLASH. A user-mode thread fully controls the values of src_dev/dst_dev and the contents of its own address space. The implementation z_impl_flash_copy() dereferences these pointers and calls through their driver-API function tables (e.g. api->get_parameters(dst_dev), flash_read(src_dev, ...), flash_write(dst_dev, ...)). By supplying a pointer to a forged struct device whose api table contains attacker-chosen function pointers, an unprivileged thread can cause the kernel to call arbitrary code in supervisor mode; passing any arbitrary or invalid address otherwise yields a kernel crash or out-of-bounds read. The result is a local privilege escalation out of the userspace sandbox (with kernel denial-of-service and information disclosure as lesser outcomes). The fix adds K_SYSCALL_DRIVER_FLASH(src_dev, read) and K_SYSCALL_DRIVER_FLASH(dst_dev, write) to z_vrfy_flash_copy(), which verify each device is a registered flash-driver kernel object the calling thread is permitted to use before any dereference, closing the path completely.
AI Analysis
Technical Summary
The flash_copy() syscall in Zephyr prior to version 4.4.2 with CONFIG_USERSPACE enabled did not validate the src_dev and dst_dev device pointers passed from user mode. This allowed a user-mode thread to supply forged struct device pointers whose API function tables contained attacker-controlled function pointers. The kernel dereferenced these pointers and called through them without validation, enabling arbitrary code execution in supervisor mode (local privilege escalation). The vulnerability also allows kernel denial-of-service or information disclosure if invalid addresses are used. The fix adds K_SYSCALL_DRIVER_FLASH() validation macros to verify that device pointers are registered flash-driver kernel objects accessible by the caller before dereference, fully mitigating the issue.
Potential Impact
An unprivileged user-mode thread can escalate privileges to kernel mode by exploiting this vulnerability, potentially executing arbitrary code with kernel privileges. Lesser impacts include kernel crashes (denial-of-service) and information disclosure due to out-of-bounds reads. The vulnerability compromises the userspace sandbox isolation, posing a significant security risk in affected Zephyr versions.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The described fix involves adding K_SYSCALL_DRIVER_FLASH() validation macros to the syscall handler to verify device pointers before use. Users should monitor the Zephyr project advisories for official patches or updates addressing this issue. Until patched, restricting unprivileged users' ability to invoke flash_copy() or disabling CONFIG_USERSPACE may reduce risk.
CVE-2026-9771: memory-safety in zephyrproject zephyr
Description
The flash_copy() system call is verified by z_vrfy_flash_copy() in drivers/flash/flash_util.c. On builds with CONFIG_USERSPACE enabled, this handler is the kernel-side trust boundary for a user-mode caller. Prior to the fix it validated only the output buffer (K_SYSCALL_MEMORY_WRITE) and passed the two struct device * arguments, src_dev and dst_dev, directly into the implementation without any object validation — unlike every sibling flash syscall, which guards its device pointer with K_SYSCALL_DRIVER_FLASH. A user-mode thread fully controls the values of src_dev/dst_dev and the contents of its own address space. The implementation z_impl_flash_copy() dereferences these pointers and calls through their driver-API function tables (e.g. api->get_parameters(dst_dev), flash_read(src_dev, ...), flash_write(dst_dev, ...)). By supplying a pointer to a forged struct device whose api table contains attacker-chosen function pointers, an unprivileged thread can cause the kernel to call arbitrary code in supervisor mode; passing any arbitrary or invalid address otherwise yields a kernel crash or out-of-bounds read. The result is a local privilege escalation out of the userspace sandbox (with kernel denial-of-service and information disclosure as lesser outcomes). The fix adds K_SYSCALL_DRIVER_FLASH(src_dev, read) and K_SYSCALL_DRIVER_FLASH(dst_dev, write) to z_vrfy_flash_copy(), which verify each device is a registered flash-driver kernel object the calling thread is permitted to use before any dereference, closing the path completely.
CVSS v3.1
Score 8.8high
Affected software
zephyrproject
zephyr
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The flash_copy() syscall in Zephyr prior to version 4.4.2 with CONFIG_USERSPACE enabled did not validate the src_dev and dst_dev device pointers passed from user mode. This allowed a user-mode thread to supply forged struct device pointers whose API function tables contained attacker-controlled function pointers. The kernel dereferenced these pointers and called through them without validation, enabling arbitrary code execution in supervisor mode (local privilege escalation). The vulnerability also allows kernel denial-of-service or information disclosure if invalid addresses are used. The fix adds K_SYSCALL_DRIVER_FLASH() validation macros to verify that device pointers are registered flash-driver kernel objects accessible by the caller before dereference, fully mitigating the issue.
Potential Impact
An unprivileged user-mode thread can escalate privileges to kernel mode by exploiting this vulnerability, potentially executing arbitrary code with kernel privileges. Lesser impacts include kernel crashes (denial-of-service) and information disclosure due to out-of-bounds reads. The vulnerability compromises the userspace sandbox isolation, posing a significant security risk in affected Zephyr versions.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The described fix involves adding K_SYSCALL_DRIVER_FLASH() validation macros to the syscall handler to verify device pointers before use. Users should monitor the Zephyr project advisories for official patches or updates addressing this issue. Until patched, restricting unprivileged users' ability to invoke flash_copy() or disabling CONFIG_USERSPACE may reduce risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- zephyr
- Date Reserved
- 2026-05-27T22:08:41.676Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a8339cebf8831d53935e30b
Added to database: 08/17/2026, 16:41:50 UTC
Last enriched: 08/17/2026, 16:56:09 UTC
Last updated: 10/01/2026, 14:51:12 UTC
Views: 66
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.