CVE-2026-13215
Received Received - Intake

Heap Overflow in Zephyr RTOS ext2 Filesystem Driver

Vulnerability report for CVE-2026-13215, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-25

Last updated on: 2026-08-25

Assigner: Zephyr Project

Description

The Zephyr ext2 filesystem driver fails to validate the s_log_block_size field of the on-disk superblock when mounting a filesystem. ext2_verify_disk_superblock() in subsys/fs/ext2/ext2_impl.c checks the magic number, revision, inode size and group counts, but never bounds s_log_block_size. On a successful verify, subsys/fs/ext2/ext2_ops.c computes fs->block_size = 1024 << superblock.s_log_block_size from this attacker-controlled uint32_t, so a crafted value either overflows the shift (undefined behaviour) or yields a block size far larger than CONFIG_EXT2_MAX_BLOCK_SIZE. That block size is then passed to k_mem_slab_init() by ext2_init_blocks_slab() to carve CONFIG_EXT2_MAX_BLOCK_COUNT blocks out of the fixed static buffer __ext2_block_memory_buffer, whose size is CONFIG_EXT2_MAX_BLOCK_COUNT * CONFIG_EXT2_MAX_BLOCK_SIZE. k_mem_slab_init() 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->block_size 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 s_log_block_size values that overflow the shift (greater than 11) or that produce a block size exceeding CONFIG_EXT2_MAX_BLOCK_SIZE, so the block slab can no longer be initialized larger than its backing buffer.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-25
Last Modified
2026-08-25
Generated
2026-08-25
AI Q&A
2026-08-25
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr 4.4.2
zephyrproject zephyr From 3.5.0 (inc) to 4.4.1 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is in the Zephyr RTOS ext2 filesystem driver. When mounting a filesystem, the driver fails to validate the s_log_block_size field in the superblock. An attacker can craft an ext2 image with a malicious s_log_block_size value that causes a shift overflow or sets an excessively large block size. This leads to an oversized slab allocation that exceeds a fixed static buffer, resulting in an out-of-bounds write when the first filesystem block is read. Since the driver runs in kernel mode, this creates a memory corruption primitive with potential for denial of service or code execution.

Detection Guidance

Detecting this vulnerability requires checking if your Zephyr RTOS system is running a vulnerable version of the ext2 filesystem driver. Inspect the mounted ext2 filesystem images for crafted superblocks with invalid s_log_block_size values. Monitor for kernel memory corruption or out-of-bounds writes during filesystem mounting.

Impact Analysis

An attacker who can provide a crafted ext2 filesystem image (e.g., via removable storage) can trigger this flaw. The impact ranges from denial of service to potential arbitrary code execution on the affected device. The vulnerability allows memory corruption in kernel space, which could compromise system integrity or stability.

Compliance Impact

This vulnerability could lead to unauthorized memory corruption or code execution in kernel mode, which may result in data breaches or loss of data integrity. Such breaches could violate GDPR's data protection requirements or HIPAA's safeguards for protected health information if exploited.

Mitigation Strategies

Upgrade Zephyr RTOS to version 4.4.2 or later, which includes the fix for validating s_log_block_size. Avoid mounting untrusted ext2 filesystem images. If upgrading is not possible, apply the patch from the Zephyr commit f270f4bd0e59585da31e1fbaa79c5abf73f1364b.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-13215. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart