Security Advisory: CVE-2025-70101 - Out-of-Bounds Read in lwext4
When traversing the extent tree of a crafted EXT4 image, lwext4 reads past the valid extent index array in ext4_ext_binsearch_idx() due to missing validation of extent header fields, causing a segmentation fault.
Summary:
ext4_ext_binsearch_idx() in ext4_extent.c performs a binary search over extent index entries using pointers derived from the EXT_FIRST_INDEX and EXT_LAST_INDEX macros. These macros compute bounds directly from the eh_entries and eh_depth fields of the extent header without verifying their consistency. A crafted image can encode zero eh_entries alongside a non-zero eh_depth, causing the macros to return invalid pointers and the binary search at line 815 to read outside the allocated buffer. The fault is triggered during directory iteration via ext4_find_extent() and ultimately ext4_dir_entry_next().
CWE:
CWE-125 - Out-of-Bounds Read
Affected Component:
```
src/ext4_extent.c:815
Function: ext4_ext_binsearch_idx()
src/ext4_extent.c:896
Function: ext4_find_extent()
```
Affected Product:
lwext4 (Lightweight EXT4 filesystem library)
Affected Version:
lwext4 1.0.0, commit 58bcf89a121b72d4fb66334f1693d3b30e4cb9c5. Affects versions based on or equivalent to the 2016-era codebase.
Attack Conditions:
An attacker supplies a specially crafted or corrupted EXT4 image to any application that integrates lwext4 for mounting and directory traversal. No elevated privileges are required; only local access (AV:L) to provide the malicious image is needed.
Impact:
The out-of-bounds read causes an immediate process crash (SEGV on READ at address 0x521000062a28), resulting in a denial of service. No evidence of code execution was observed.
Fix / mitigation status:
The issue is addressed in lwext4 v1.0.1, released by Aladdin-R-D. Users should upgrade to v1.0.1 or apply the corresponding patch.
References
- Issue: https://github.com/gkostka/lwext4/issues/91
- PoC: https://github.com/sigdevel/pocs/blob/main/res/lwext4/3/sig11_lwext4_ext4_extent_815
- Fix: https://github.com/Aladdin-R-D/lwext4/releases/tag/v1.0.1
Credit
Alexander A. Shvedov (@sigdevel) & Daniil Dulov
#fuzzing #infosec #security #afl #revers #cybersecurity #bugbounty #vulnerability #opensource #linux #cve #advisory #EXT4 #lwext4 #filesystem











Qiita - 人気の記事