4.7medium
util-linux: TOCTOU Race Condition in util-linux mount(8) - Loop Device Setup
- Severity
- 4.7medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.17% (higher than 6% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
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 O_NOFOLLOW, 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
| Product or package | Versions | Reported by |
|---|---|---|
| util-linux util-linux | < 2.41.4 | CVE List |
| kernel util-linux | before 2.41.4 | NVD |
Classification
What each source says
CVE List
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 O_NOFOLLOW, 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.
NVD (es)
util-linux es una colección aleatoria de utilidades de Linux. Antes de la versión 2.41.4, se ha identificado una vulnerabilidad TOCTOU (Time-of-Check-Time-of-Use) en el binario SUID /usr/bin/mount de util-linux. El binario mount, al configurar dispositivos de bucle, valida la ruta del archivo de origen con privilegios de usuario a través de fork() + setuid() + realpath(), pero posteriormente la vuelve a canonizar y la abre con privilegios de root (euid=0) sin verificar que la ruta no haya sido reemplazada entre ambas operaciones. No se emplean ni O_NOFOLLOW, ni la comparación de inodos, ni fstat() posterior a la apertura. Esto permite a un usuario local sin privilegios reemplazar el archivo de origen con un enlace simbólico que apunte a cualquier archivo o dispositivo propiedad de root durante la ventana de carrera, haciendo que el binario SUID lo abra y monte como root. La explotación requiere una entrada en /etc/fstab con las opciones user,loop cuya ruta apunte a un directorio donde el atacante tenga permiso de escritura, y que /usr/bin/mount tenga el bit SUID establecido (la configuración predeterminada en prácticamente todas las distribuciones de Linux). El impacto es el acceso de lectura no autorizado a archivos protegidos por root y dispositivos de bloque, incluyendo imágenes de respaldo, volúmenes de disco y cualquier archivo que contenga un sistema de archivos válido. Este problema ha sido parcheado en la versión 2.41.4.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27456 changed 2026-04-06 | CVE Terms of Use |
| NVD | CVE-2026-27456 changed 2026-07-24 | Public domain |