Skip to main content
EPSS 0.1%top 97%

CVE-2026-9771: memory-safety in zephyrproject zephyr

0
High
VulnerabilityCVE-2026-9771cvecve-2026-9771
Published: 08/17/2026 (08/17/2026, 16:18:52 UTC)
Source: CVE Database V5
Vendor/Project: zephyrproject
Product: 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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Affected software

zephyrproject

zephyr

Affected versions
>=4.0.0 <4.4.2
GitHub Actionsmore threats →cve
zephyr
pkg:github/zephyr
Affected versions
>=4.0.0 <4.4.2

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

AILast updated: 08/17/2026, 16:56:09 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses