Security Experts:

Connect with us

Hi, what are you looking for?



Remote Code Execution Flaw Impacts E2fsprogs Filesystem Utility

An out-of-bounds write bug in the E2fsprogs filesystem utility could lead to remote code execution, Cisco Talos security researchers reveal.

An out-of-bounds write bug in the E2fsprogs filesystem utility could lead to remote code execution, Cisco Talos security researchers reveal.

E2fsprogs is a set of utilities designed for interaction with ext2, ext3 and ext4 filesystems. Considered essential for Linux and Unix-like operating systems, the software ships by default on most Linux distributions.

One of E2fsprogs’ components is the e2fsck binary, which aims to fix corrupted filesystems, and which Cisco Talos found to contain the out-of-bounds write flaw.

The implementation of directories in ext2, 3 and 4 involves the use of hash trees for the unique mapping of files within a directory. The hash entries for the hash tree are contained within hash_entry struct, while the number of hash entries is contained within num_array.

To maintain the integrity and assumptions of a hash table, all the entries should be unique, a requirement that e2fsck enforces by appending the second file name in a collision with {~0, ~1, …, ~n}, depending on the number of duplicates, Talos says.

A temporary stack buffer is used to temporarily store mutated names to write them to the disk later on, and the utility then iterates over each hash_entry struct. When a collision is met, the length of the current file name is extracted and then the mutate_name function is used to perform changes.

What the security researchers discovered was that the process was prone to an out-of-bounds stack. The issue resides in the E2fsprogs e2fsck rehash.c mutate_name() function, resulting in the directory rehashing functionality being abused for code execution.

A specially crafted ext4 directory could be used to cause an out-of-bounds write on the stack, leading to code execution. In order to trigger the vulnerability, the attacker would need to corrupt a partition, Talos’ researchers explain.

On 64-bit systems, exploitation is very unlikely, because the stack is not big enough and a user-controlled method for expanding the stack is required, the researchers explain.

On 32-bit versions, on the other hand, the end result is more dependent on the binary itself and on the manner it was compiled, Talos says.

Tracked as CVE-2019-5188 and featuring a CVSS score of 7.5, the vulnerability was disclosed to the vendor on December 18, 2019, and acknowledged on December 20. Versions 1.43.3 – 1.45.3 of E2fsprogs were found affected by this vulnerability. An update that patches the flaw was released this week.

Related: Code Execution Vulnerabilities Patched in Accusoft ImageGear

Related: Cisco Finds 11 Vulnerabilities in Schneider Electric Modicon Controllers

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Expert Insights

Related Content

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

Mobile & Wireless

Technical details published for an Arm Mali GPU flaw leading to arbitrary kernel code execution and root on Pixel 6.

Mobile & Wireless

Apple rolled out iOS 16.3 and macOS Ventura 13.2 to cover serious security vulnerabilities.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Mobile & Wireless

Apple’s iOS 12.5.7 update patches CVE-2022-42856, an actively exploited vulnerability, in old iPhones and iPads.


Security researchers have observed an uptick in attacks targeting CVE-2021-35394, an RCE vulnerability in Realtek Jungle SDK.

Email Security

Microsoft is urging customers to install the latest Exchange Server updates and harden their environments to prevent malicious attacks.


Google has awarded more than $25,000 to the researchers who reported the vulnerabilities patched with the release of the latest Chrome update.