The Zephyr ext2 filesystem driver fails to validate the slogblocksize field of the on-disk superblock when mounting a filesystem. ext2verifydisksuperblock() in subsys/fs/ext2/ext2impl.c checks the magic number, revision, inode size and group counts, but never bounds slogblocksize. On a successful verify, subsys/fs/ext2/ext2ops.c computes fs->blocksize = 1024 << superblock.slogblocksize from this attacker-controlled uint32t, so a crafted value either overflows the shift (undefined behaviour) or yields a block size far larger than CONFIGEXT2MAXBLOCKSIZE.
That block size is then passed to kmemslabinit() by ext2initblocksslab() to carve CONFIGEXT2MAXBLOCKCOUNT blocks out of the fixed static buffer _ext2blockmemorybuffer, whose size is CONFIGEXT2MAXBLOCKCOUNT * CONFIGEXT2MAXBLOCKSIZE. kmemslabinit() does not verify that the requested blocks fit the buffer, and the ext2 wrapper discards its return value, so the slab is laid out past the end of the static buffer. The mount immediately reads block-group, bitmap and inode blocks of fs->blocksize bytes each into these slab blocks, producing an out-of-bounds write into adjacent static memory on the first block read.
The entire path is gated only by data read from the mounted image, making this reachable by any attacker who can present a crafted ext2 image to a device that mounts it (for example a removable SD card or storage medium). Because the ext2 driver runs in kernel mode, supplying image bytes yields a supervisor-mode memory-corruption primitive, with impact ranging from denial of service to potential code execution.
The fix rejects slogblocksize values that overflow the shift (greater than 11) or that produce a block size exceeding CONFIGEXT2MAXBLOCK_SIZE, so the block slab can no longer be initialized larger than its backing buffer.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/13xxx/CVE-2026-13215.json",
"cwe_ids": [
"CWE-787"
],
"cna_assigner": "zephyr"
}[
{
"id": "CVE-2026-13215-9afe485c",
"target": {
"file": "subsys/fs/ext2/ext2_impl.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"285705342183874838886881605057276189771",
"111536562401550203750441799583889426919",
"6123786931226334703979409887514339352"
]
},
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/f270f4bd0e59585da31e1fbaa79c5abf73f1364b",
"signature_type": "Line"
},
{
"id": "CVE-2026-13215-cb3a90d3",
"target": {
"function": "ext2_verify_disk_superblock",
"file": "subsys/fs/ext2/ext2_impl.c"
},
"deprecated": false,
"digest": {
"function_hash": "163845325967637394422321408264195061529",
"length": 2606.0
},
"signature_version": "v1",
"source": "https://github.com/zephyrproject-rtos/zephyr/commit/f270f4bd0e59585da31e1fbaa79c5abf73f1364b",
"signature_type": "Function"
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-13215.json"
"2026-08-28T14:32:59Z"