Sceawere
Vulnerability Detail
CVE-2026-11743UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
SF32LB QSPI Driver Out-of-Bounds Vulnerability
Vulnerability Metadata
- Severity
- Medium
- Score / CVSS
- 6.6
- Creation Date
- 15h ago
- Vendor
- zephyrproject
- Product
- zephyr
- Attack Type
- bounds
- Vector String
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
- Attack Complexity
- LOW
Narrative and Response
Description
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.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "6.6",
"pubDate": "2026-08-07T22:16:57.317Z",
"pubdate": "2026-08-07T22:16:57.317Z",
"executiveSummary": "An out-of-bounds memory access vulnerability exists in the SF32LB MPI QSPI NOR flash driver located within drivers/flash/flash_sf32lb_mpi_qspi_nor.c.\nThe vulnerability is caused by improper type conversion and sign handling during offset validation in the read and write paths.\nAn unprivileged attacker with access to the flash device can exploit this flaw to perform arbitrary memory disclosure, unauthorized flash programming, and cache invalidation operations.\nIn builds where CONFIG_USERSPACE is enabled, flash_read and flash_write act as system calls that delegate offset bounds checking entirely to the driver.\nAn untrusted thread granted access to the flash device can supply a crafted negative offset, bypassing the insecure validation check.\nThis leads to severe impacts on confidentiality, integrity, and availability, potentially allowing the reading of unauthorized memory regions and arbitrary memory manipulation.\nExploitation requires userspace to be enabled, explicit access to the raw flash device object, and an attacker capable of executing code within the application context.",
"technicalDetails": "The root cause of the vulnerability stems from mismatched data types used in offset and size validation checks within drivers/flash/flash_sf32lb_mpi_qspi_nor.c.\nSpecifically, the driver previously validated flash offsets and lengths on read and write paths using the expression (offset + size) > data->size.\nBecause the offset variable is defined as a signed off_t while the size variable is unsigned, supplying a negative offset causes it to be implicitly converted into a large unsigned value.\nWhen added to the size, this value can wrap around to a small result, successfully bypassing the conditional boundary check.\nOn the read path, the driver subsequently performs a memcpy(dst, (void *)(data->base + offset), size), and on the write path, it programs flash and performs a cache invalidation on data->base + offset.\nBecause the offset is improperly validated, both paths result in memory accesses outside the mapped flash window.\nIn configurations utilizing CONFIG_USERSPACE, the flash_read and flash_write functions operate as system calls whose verifiers validate only the device object and the caller-provided buffer, deliberately delegating offset bounds checking to the underlying driver.\nAn unprivileged thread granted access to the flash device can invoke the system call with a crafted negative offset combined with a valid memory buffer in its own domain.\nDuring exploitation, the attacker slides the memcpy source below the flash base address, copying arbitrary CPU-addressable memory into the destination buffer and directly disclosing unauthorized memory.\nSimilarly, the write path allows programming flash at out-of-range addresses and invalidating arbitrary cache ranges, impacting system integrity and availability.\nAdditionally, an unvalidated DMA operation creates a separate bus-hang condition due to potential source and destination memory overlaps."
}