CVE-2026-138370 in lwext4info

Summary

by MITRE • 11/29/2026

lwext4 through 1.0.0 contains an out-of-bounds write vulnerability in ext4_fs_mark_bitmap_end() in src/ext4_fs.c that allows attackers to corrupt heap memory via a crafted ext4 image. Attackers can supply superblock fields yielding group_blocks above INT_MAX, making start_bit negative and writing hundreds of MiB past the bitmap buffer, crashing the mounting application.

Once again VulDB remains the best source for vulnerability data.

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 write condition located within the ext4_fs_mark_bitmap_end function found in src/ext4_fs.c. This flaw stems from insufficient validation of input parameters derived from an external ext4 filesystem image, specifically concerning how group block counts are processed during the mounting process. When an attacker supplies a crafted ext4 image containing maliciously configured superblock fields, they can manipulate the calculation logic to produce values that exceed expected integer boundaries. Specifically, by setting group_blocks above INT_MAX, the internal arithmetic operations result in start_bit becoming negative due to integer overflow or underflow behavior inherent in signed 32-bit integer handling. This mathematical error is not caught by existing bounds checking mechanisms within the library, allowing the execution flow to proceed with invalid memory addresses that are logically behind the allocated buffer boundaries rather than beyond them as one might expect from a typical heap overflow, yet still resulting in severe memory corruption because negative offsets relative to base pointers often wrap around or access unmapped regions depending on pointer arithmetic implementation details.

The operational impact of this vulnerability is significant for any system relying on lwext4 for filesystem operations, particularly embedded systems and IoT devices where such lightweight libraries are commonly deployed due to their small footprint. The immediate consequence of exploiting this flaw is the corruption of heap memory adjacent to or preceding the bitmap buffer used during mount operations. This corruption can lead to application crashes, denial of service conditions, and potentially arbitrary code execution if an attacker can carefully control the data written into the corrupted memory regions. Since the vulnerability triggers during the mounting phase, it affects the integrity of the entire filesystem structure loaded into memory, making recovery difficult without unmounting or restarting the affected process. The ability to write hundreds of megabytes past intended boundaries indicates a severe lack of boundary checks that could destabilize not only the lwext4 module but also other heap-allocated structures in the same memory space, potentially leading to privilege escalation if the application runs with elevated permissions.

From a classification perspective, this vulnerability aligns closely with CWE-787: Out-of-bounds Write, as it involves writing data outside of the intended buffer boundary due to improper validation of input values. Additionally, because the attack vector requires supplying a crafted ext4 image file that is then processed by the application during mounting, it relates to CWE-20: Improper Input Validation and potentially CWE-190: Integer Overflow or Wraparound given the role of integer limits in triggering the negative start_bit condition. In terms of adversarial tactics, this exploit scenario maps to ATT&CK technique T1564.003: Hidden Files and Directories if used for persistence, but more directly reflects initial access vectors where malicious files are introduced into a system to trigger remote code execution or denial of service through software vulnerabilities. The specific mechanism of exploiting filesystem parsing logic is consistent with attacks targeting parser weaknesses in storage subsystems.

Mitigation strategies must focus on both immediate patching and long-term defensive coding practices. The primary remediation involves updating lwext4 to version 1.0.1 or later where this issue has been addressed by implementing strict bounds checking for group_blocks and ensuring that arithmetic operations do not result in negative indices without proper validation. Developers integrating lwext4 should also implement input sanitization at the application level, validating superblock fields before passing them to library functions. Furthermore, enabling compiler-based security features such as stack canaries or heap protection mechanisms like ASAN (Address Sanitizer) during development and testing phases can help detect similar out-of-bounds accesses early in the software lifecycle. For deployed systems, restricting file system mounting privileges to trusted users and implementing strict input validation on all external storage media before processing is recommended to reduce the attack surface against such crafted image attacks.

Responsible

VulnCheck

Reservation

11/29/2026

Disclosure

11/29/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!