util-linux mount hook_owner TOCTOU allows local privilege escalation
What fixes it
No source in this snapshot names a fixed version. The vendor advisories under References are the place to check.
Description
util-linux is a random collection of Linux utilities. In util-linux 2.39 through 2.41.4 and 2.42 through 2.42.1, the SUID mount utility's hook_owner.c post-mount hook performs path-based chmod() and lchown() operations on a previously validated mount target. A local low-privileged user authorized by an /etc/fstab entry with user or users and an X-mount.mode, X-mount.owner, or X-mount.group option can use renameat2(RENAME_EXCHANGE) to race a writable ancestor of the target and redirect the privileged ownership or mode change to a root-owned path, potentially gaining root privileges. This issue is fixed in 2.41.5 and 2.42.2.
Text from CVE List
Affected versions 2
- util-linuxaffected: >= 2.39, < 2.41.5CVE List
- util-linuxaffected: >= 2.42, < 2.42.2CVE List
References 7
- github.com/util-linux/util-linux/commit/24da33905c7115c4cbccd0afb2a469804e96467aFixvia CVE List
- github.com/util-linux/util-linux/commit/722c96974dd4009a334e4aee556eedaab5fb94b4Fixvia CVE List
- github.com/util-linux/util-linux/commit/897a08c2b11dfa66975c3d24d63c7bf5f5be1a7cFixvia CVE List
- github.com/util-linux/util-linux/commit/d0c5adaeb3a3d823aba1377794de8f009b8152ccFixvia CVE List
- github.com/util-linux/util-linux/releases/tag/v2.41.5Fixvia CVE List
- github.com/util-linux/util-linux/releases/tag/v2.42.2Fixvia CVE List
- github.com/util-linux/util-linux/security/advisories/GHSA-g8wm-75wr-g2vhExploitvia CVE List