REDHAT-BUG-2454956: Medium severity util-linux util-linux vulnerability
util-linux is a random collection of Linux utilities. Prior to version 2.41.4, a TOCTOU (Time-of-Check-Time-of-Use) vulnerability has been identified in the SUID binary /usr/bin/mount from util-linux. The mount binary, when setting up loop devices, validates the source file path with user privileges via fork() + setuid() + realpath(), but subsequently re-canonicalizes and opens it with root privileges (euid=0) without verifying that the path has not been replaced between both operations. Neither ONOFOLLOW, nor inode comparison, nor post-open fstat() are employed. This allows a local unprivileged user to replace the source file with a symlink pointing to any root-owned file or device during the race window, causing the SUID binary to open and mount it as root. Exploitation requires an /etc/fstab entry with user,loop options whose path points to a directory where the attacker has write permission, and that /usr/bin/mount has the SUID bit set (the default configuration on virtually all Linux distributions). The impact is unauthorized read access to root-protected files and block devices, including backup images, disk volumes, and any file containing a valid filesystem. This issue has been patched in version 2.41.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
util-linuxto a version that resolves this vulnerability.Fixed in 2.41.4
Event History
Frequently Asked Questions
Which systems are realistically exposed?
Systems are exposed when /usr/bin/mount is SUID and an /etc/fstab entry uses both the user and loop options with a source path in a directory writable by an unprivileged attacker. The SUID setting is described as the default on virtually all Linux distributions.
What does an attacker need to exploit this issue?
The attacker needs local unprivileged access and the ability to replace the configured loop-device source path with a symlink during the race window. They also need a qualifying /etc/fstab entry whose path is in a directory they can write to.
How can I check whether my configuration is vulnerable to exploitation?
Check whether /usr/bin/mount has the SUID bit set, then review /etc/fstab for entries combining user and loop. For each such entry, determine whether the source file path is located in a directory writable by unprivileged users.
What is the practical impact if exploitation succeeds?
An attacker can cause mount to open and mount a root-protected file or block device as root. This can provide unauthorized read access to protected files, backup images, disk volumes, and files containing a valid filesystem.
What version addresses the vulnerable behavior?
The issue affects util-linux versions prior to 2.41.4. Updating to version 2.41.4 or later removes the described vulnerable version range.