Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
Local vector confirmed by thread execution context; PR:L because device object must be explicitly granted; C:H for arbitrary memory read; I:L/A:L for out-of-range flash write and cache invalidation.
Primary rating from Vendor (zephyr).
CVSS VectorVendor: zephyr
Lifecycle Timeline
2DescriptionCVE.org
The SF32LB MPI QSPI NOR flash driver (drivers/flash/flash_sf32lb_mpi_qspi_nor.c) validated the flash offset and length on its read and write paths with the test (offset + size) > data->size. Because offset is a signed off_t while size is unsigned, a negative offset is converted to a large unsigned value and the addition can wrap to a small result that passes the check. The read path then performs memcpy(dst, (void *)(data->base + offset), size) and the write path programs flash at offset and cache-invalidates data->base + offset, in both cases accessing memory outside the mapped flash window. The driver's erase path already rejected negative offsets, but read and write did not.
In builds with CONFIG_USERSPACE, flash_read and flash_write are syscalls whose verifiers validate the device object and the caller's buffer but deliberately delegate offset bounds checking to the driver. An unprivileged thread that has been granted access to this flash device can therefore call the syscall with a crafted negative offset and a buffer valid in its own memory domain, and reach the unchecked access.
The most direct impact is on the read path: by choosing a negative offset and matching size, an attacker slides the memcpy source below the flash base and copies arbitrary CPU-addressable memory into its own buffer, disclosing memory it is not authorized to read. The write path additionally allows programming flash at an out-of-range address and invalidating an attacker-chosen cache range, affecting integrity and availability. Reachability requires userspace to be enabled and the raw flash device object to be granted to an untrusted thread.
The fix replaces the check with qspi_nor_range_is_valid(), which rejects negative offsets and performs the bound comparison in overflow-safe 64-bit arithmetic on both paths, and additionally adds an SRAM DMA bounce buffer plus source/destination overlap rejection to prevent a separate DMA bus-hang condition.
AnalysisAI
Out-of-bounds memory read and write in the Zephyr RTOS SF32LB MPI QSPI NOR flash driver allows a low-privileged thread, when explicitly granted flash device access in a CONFIG_USERSPACE build, to disclose arbitrary CPU-addressable memory or corrupt flash and invalidate cache beyond the mapped flash window. The root cause is a signed/unsigned type confusion in the offset bounds check: a crafted negative off_t value converts to a large unsigned integer and the subsequent addition wraps to a small result that passes the check, allowing memcpy to read from or program flash at attacker-controlled addresses. No public exploit code has been identified at time of analysis; exploitation is nonetheless mechanically straightforward for any attacker familiar with signed/unsigned integer confusion vulnerabilities.
Technical ContextAI
The affected component is the SF32LB MPI QSPI NOR flash driver (drivers/flash/flash_sf32lb_mpi_qspi_nor.c) in the Zephyr Project RTOS (CPE: cpe:2.3:a:zephyrproject:zephyr:*:*:*:*:*:*:*:*). The root cause is classified as CWE-125 (Out-of-Bounds Read), arising from a classic signed/unsigned type mismatch: the offset parameter is declared as off_t (a signed integer) while size is unsigned. The pre-fix bounds check (offset + size) > data->size is evaluated after implicit unsigned promotion - a negative off_t becomes a very large unsigned value, and the addition can wrap to a small positive result that passes the comparison. Zephyr's CONFIG_USERSPACE feature exposes flash_read and flash_write as system calls; the syscall entry points validate the device object and caller buffer but intentionally defer offset range checking to the driver itself, creating a direct path from unprivileged user space to the vulnerable arithmetic. The erase path had already been hardened against negative offsets; only the read and write paths were affected. The fix introduces qspi_nor_range_is_valid(), which explicitly rejects negative offsets and performs the range comparison in overflow-safe 64-bit arithmetic, alongside an SRAM DMA bounce buffer and source/destination overlap checks to close a secondary DMA bus-hang condition.
RemediationAI
The upstream fix is available as commit 909eb568750304d68ea481d1b56a489ae670bdae in the Zephyr repository at https://github.com/zephyrproject-rtos/zephyr/commit/909eb568750304d68ea481d1b56a489ae670bdae; a specific tagged release version incorporating this fix has not been independently confirmed from the available data, so integrators should verify against the Zephyr release changelog directly. The fix replaces the vulnerable (offset + size) > data->size check in both flash_sf32lb_mpi_qspi_nor_read() and flash_sf32lb_mpi_qspi_nor_write() with qspi_nor_range_is_valid(), which first rejects negative offsets and then performs the range comparison using overflow-safe 64-bit arithmetic, and additionally introduces a write_buf SRAM bounce buffer and source/destination overlap detection. If the patch cannot be applied immediately, the most targeted compensating control is to revoke any untrusted thread's access to the raw flash device object, which eliminates the attack path entirely without architectural side effects. Alternatively, disabling CONFIG_USERSPACE removes the user-space syscall surface but represents a significant firmware architecture change with broad functional consequences and should only be considered if the user-space separation model is not required. See https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-c6wh-gwg4-fj5j for official vendor guidance.
Potential off-by-one buffer overflow vulnerability in the Zephyr fuse file system. Rated critical severity (CVSS 10.0),
Possible variant of CVE-2021-3434 in function le_ecred_reconf_req. Rated critical severity (CVSS 9.8), this vulnerabilit
Unchecked user input length in /subsys/net/l2/wifi/wifi_shell.c can cause buffer overflows. Rated critical severity (CVS
Potential buffer overflow vulnerability in the Zephyr CAN bus subsystem. Rated critical severity (CVSS 9.8), this vulner
Integer Underflow in 6LoWPAN IPHC Header Uncompression in Zephyr. Rated critical severity (CVSS 9.8), this vulnerability
Buffer overflow in Zephyr USB DFU DNLOAD. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable
DOS: Incorrect 802154 Frame Validation for Omitted Source / Dest Addresses. Rated critical severity (CVSS 9.8), this vul
zephyr-rtos version 1.12.0 contains a NULL base pointer reference vulnerability in sys_ring_buf_put(), sys_ring_buf_get(
Potential buffer overflow vulnerabilities n the Zephyr Bluetooth subsystem. Rated critical severity (CVSS 9.6), this vul
Buffer overflow in Zephyr RTOS dns_unpack_name() function causing OOB writes. PoC available.
The documentation specifies that the BT_GATT_PERM_READ_LESC and BT_GATT_PERM_WRITE_LESC defines for a Bluetooth characte
Potential buffer overflows in the Bluetooth subsystem due to asserts being disabled in /subsys/bluetooth/host/hci_core.c
Same weakness CWE-125 – Out-of-bounds Read
View allSame technique Buffer Overflow
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-54682