CVE-2026-138368 in lwext4info

Summary

by MITRE • 11/29/2026

lwext4 through 1.0.0 contains an out-of-bounds read vulnerability in ext4_dir_dx_checksum() in src/ext4_dir_idx.c because the dx root count field is never validated against limit. Attackers can supply a crafted ext4 image with metadata_csum and a large HTree count, making crc32c read about 512 KiB past the heap buffer and crash the application.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/29/2026

The vulnerability identified in lwext4 versions up to 1.0.0 represents a critical out-of-bounds read condition located within the ext4_dir_dx_checksum function found in the source file src/ext4_dir_idx.c. This flaw stems from an insufficient validation of metadata integrity checks, specifically concerning the hash tree (HTree) root count field used for directory indexing in the Ext4 filesystem implementation. In a properly secured system, any value read from disk or network sources must be rigorously validated against expected bounds before being utilized to allocate memory or perform array accesses. However, in this specific code path, the dx_root_count variable is extracted directly from the ext4 inode metadata without verifying that it falls within acceptable limits relative to the allocated buffer size. This lack of boundary checking allows an attacker who can supply a crafted Ext4 image file to trigger the vulnerability by setting the HTree count to an abnormally large value.

When the application processes this maliciously constructed filesystem image, the ext4_dir_dx_checksum function proceeds to calculate checksums for directory entries using the unvalidated count field. The calculation logic relies on iterating through or accessing memory regions based on this count. Because the count is not constrained by the actual size of the heap buffer allocated for storing these directory index structures, the subsequent CRC32C computation attempts to read data far beyond the intended boundaries. Specifically, the vulnerability allows an attacker to force a read operation that extends approximately 512 KiB past the end of the heap-allocated buffer. This massive out-of-bounds memory access violates standard memory safety protocols and leads directly to application instability or termination via segmentation fault or similar crash mechanism.

From a security classification perspective, this issue aligns with CWE-126, which denotes Buffer Over-read vulnerabilities where software reads past the end of a buffer. It also relates closely to CWE-20, Improper Input Validation, as the root cause is the failure to sanitize and validate user-controlled or file-based input data before processing. In terms of adversarial tactics, this vulnerability can be leveraged within the ATT&CK framework under techniques associated with Denial of Service (T1499) due to its ability to crash applications, potentially serving as a precursor for more complex attacks if combined with other memory corruption flaws or used in resource exhaustion scenarios. The impact is primarily availability-related, causing denial of service through application crashes when the lwext4 library processes untrusted filesystem images.

Mitigation strategies must focus on implementing strict input validation and bounds checking within the ext4_dir_dx_checksum function. Developers should ensure that all fields extracted from Ext4 metadata structures are validated against their respective maximum allowable values before being used in arithmetic operations or memory access patterns. Specifically, the dx_root_count field must be checked to confirm it does not exceed limits derived from the allocated buffer size and filesystem block constraints. Additionally, integrating static analysis tools capable of detecting out-of-bounds reads during development can help identify such logic errors early. For systems already deployed with affected versions, applying patches that include these validation checks is essential. If patching is not immediately feasible, restricting the ability to mount or process untrusted Ext4 images provides a temporary operational mitigation against exploitation attempts targeting this specific memory safety flaw.

Responsible

VulnCheck

Reservation

11/29/2026

Disclosure

11/29/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!