Site icon Secplicity – Security Simplified

Linux Vulnerability: sudo Configuration File

Joe Vennix of Apple Information Security discovered a vulnerability pertaining to the ever popular “sudo” command used in Linux systems. If you’re not aware of what sudo is used for, sudo allows non-administrative users (e.g., normal, unprivileged users) to execute commands as another user or, most commonly, the superuser (i.e., root). This is sometimes necessary to have access to system resources that requires root access. One example would be running a tcpdump command to capture network traffic.

CVE-2019-14287 is a security policy bypass issue that attackers could use to execute arbitrary commands. The CVE information states that if users have sudo privileges to run commands except as root, then the following command would effectively allow them to bypass the security mechanisms in place:

sudo -u#-1 id -u 

OR

sudo -u#4294967295 id -u

 

Seclists.org provided an example of a user configuration setting within the /etc/sudoers configuration file as:

myhost bob = (ALL, !root) /usr/bin/vi 

This configuration allows the user (“bob”) to run the “vi” command as any user EXCEPT for root (“!root”). That said, calling the sudo command with the above parameters would allow “bob” to run the “vi” command as root. Here is a YouTube video demonstrating this vulnerability.

 

Key Takeaways

Systems are only vulnerable if and only if a user is configured with the “ALL” keyword within the parenthesis; a.k.a. the “Runas” specifier. For example, the following entry wouldn’t allow a user to bypass the security mechanisms in place:

emil = /usr/bin/id

The above example would allow that user (“emil”) to run the “id” command only as root. Attempting to use the command as any other user will be denied.

Lastly, this isn’t really any issue if you don’t have users specified in the sudoers configuration file. Regardless if this doesn’t apply to you, I suggest updating sudo to be on the safe side.

Exit mobile version