Security researchers are documenting a new vulnerability found in the util-linux core utilities package in Linux systems, warnign that it allows attackers to leak user passwords and modify the clipboard.
The security defect, tracked as CVE-2024-28085 and dubbed ‘WallEscape’, impacts the ‘wall’ command of util-linux that fails to filter escape sequences from command line arguments.
An attacker could embed escape sequences into crafted messages and send them via the ‘wall’ command, allowing them to leak passwords and modify commands, if specific conditions are met. “This allows unprivileged users to put arbitrary text on other users’ terminals, if mesg is set to y and wall is setgid,” said security researcher Skyler Ferrante.
Ferrante, who is credited with discovering the flaw, said the bug can be exploited to leak user passwords on Ubuntu 22.04 with default configurations, where ‘wall’ is installed with the special setgid permissions and mesg is set to y. Debian Bookworm is also affected, but CentOS and Red Hat products are not.
“On Ubuntu 22.04, we have enough control to leak a user’s password by default. The only indication of attack to the user will be an incorrect password prompt when they correctly type their password, along with their password being in their command history,” the researcher explained in a public advisory.
According to Ferrante, the flaw can also leak an unknown command on Ubuntu 22.0 “if a system runs a command when commands are not found, with the unknown command as an argument.” In addition, it can be exploited to change the output of any command.
“On other systems that allow wall messages to be sent, an attacker may be able to alter the clipboard of a victim. This works on windows-terminal, but not on gnome-terminal,” the researcher said.
Ferrante, who also provided proof-of-concept (PoC) code, says that the vulnerability can be used to attack sudo or “anywhere the user inputs their password”. An attacker could send an incorrect password message after a user logs in using OpenSSH, for example.
According to a NIST NVD advisory, “there may be plausible scenarios where this leads to account takeover.” The vulnerability was introduced in 2013 and impacts all util-linux releases prior to version 2.40, which includes patches for this bug.
Related: Supply Chain Attack: Major Linux Distributions Impacted by XZ Utils Backdoor
Related: Android, Linux, Apple Devices Exposed to Bluetooth Keystroke Injection
Related: Severe Glibc Vulnerability Impacts Major Linux Distributions