A bug has been found in the SUDO command which can allow an attacker to gain root privilege on Linux and Unix systems, even for users that do not have permission to run SUDO.
SUDO is a security tool used daily in most organisations. SUDO allows users to execute a specific command with escalated privilege without needing to know the password to login to the more powerful account.
The bug affects systems that have the pwfeedback option active (it is turned off by default in all but a few distributions of Linux). Exploitation of the bug requires only that the pwfeedback option is enabled, the attacker’s login does not need permission to use SUDO in the sudoers file.
You can check if pwfeedback is enabled on your system by issuing the command:
sudo -l
If pwfeedback is listed in the Matching-Entries output then it is enabled and the system is vulnerable.
The default password prompt on Linux and Unix systems does not provide any feedback when a key is pressed, which can make it harder for users to enter their password correctly -especially if they do not use SUDO very often. The pwfeedback option prints a single * for each key press while entering a password.
Due to a bug in the way pwfeedback handles errors when it attempts to write the * to the display, a stack-based buffer overflow can be triggered which can then be exploited. Details of how the bug can be exploited are listed on the SUDO website.
The bug affects all versions of SUDO from 1.7.1 to 1.8.30, and is tracked as CVE-2019-18634. The fix to this vulnerability is contained in SUDO 1.8.31 released at the end of January 2020.
“We were very impressed with the service, I will say, the vulnerability found was one our previous organisation had not picked up, which does make you wonder if anything else was missed.”
Aim Ltd Chief Technology Officer (CTO)