Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Application Security

04:55 PM
Connect Directly

Critical Vulnerability Patched in 'sudo' Utility for Unix-Like OSes

Flaw exists in versions of sudo going back nearly 10 years; USCYBERCOM recommends organizations patch immediately.

The maintainer of sudo, a utility in nearly all Unix and Linux-based operating systems, this week patched a critical buffer overflow vulnerability in the program that gives unauthenticated local users a way to gain root privileges on a host system.

Qualys security researchers who discovered the nearly 10-year-old bug (CVE-2021-3156) say it was first introduced in July 2011 and impacts all versions of sudo from 1.8.2 to 1.8.31p2 and 1.9.0 through 1.9.5p1.

Related Content:

DreamBus, FreakOut Botnets Pose New Threat to Linux Systems

Special Report: 2021 Top Enterprise IT Trends

New From The Edge: Learn SAML: The Language You Don't Know You're Already Speaking

The researchers were able to independently verify the vulnerability and exploit it in multiple ways to gain root privileges on Debian 10 with sudo 1.8.27; Ubuntu 20.04 and sudo 1.8.31; and Fedora 33 with sudo 1.9.2, according to Qualys. Other operating systems and distributions are likely vulnerable to the same issue.

No mitigations are available for the threat. Qualys recommends that all organizations using Unix and Linux distributions with sudo-enabled in them immediately implement vendor supplied patches or upgrade to sudo 1.9.5p2, the latest version of the utility. It was released this week.

"Patching is the only option," says Mehul Revankar, vice president of product management and engineering at Qualys.

The seriousness of the bug prompted a tweet from US Cyber Command (USCYBERCOM) Wednesday, urging organizations to patch as soon as possible. "This is a far more dangerous #Sudo vulnerability than seen in the recent past," it tweeted.

To test whether a system is vulnerable, an admin should log into the system as a non-root user and run the "sudoedit -s /" command.

"If the system is vulnerable, it will respond with an error that starts with 'sudoedit:'," Revankar says. "If the system is patched, it will respond with an error that starts with 'usage:'."

Sudo is a utility that administrators can use to delegate root-level admin authority to specific users or groups of users while copiously logging all their commands and activities. Administrators can use the utility to enable or restrict what commands a user can execute on a host system and to centrally manage user privileges on a per-host basis.

Software engineer Todd Miller, who currently maintains sudo, on Tuesday said the heap-based buffer overflow bug exists in code that executes when sudo runs a command in shell mode via the use of -s and –I options. (Read here for details.) By itself, the bug is harmless. However, the presence of another bug in sudo's command-line parsing code makes the discovery of the new issue dangerous, he notes.

"I'd speculate that it remained undiscovered for so long because it is a combination of two bugs," Revankar says. "Thus, people might have found one bug but disregarded it as useless because they did not find the other."

An attacker would need local access to a vulnerable system in order to exploit the vulnerability. In many instances, this would mitigate the seriousness of the flaw because an adversary that already has access to a system can do a lot of damage with that access.

What makes this flaw dangerous is that an unauthenticated attacker can use it to escalate privileges even if not listed in the "sudoers" file, which allocates admin rights to specific individuals.

"The user does not need to be a privileged user, a local user, or be a part of sudoers list," Revankar says. "For example, even account 'nobody' can exploit the issue. That's why this is so critical."

A local vulnerability usually doesn't require panic since an attacker needs another vulnerability to gain access to the system first, adds Kelly Shortridge, vice president of product strategy at Capsule8.

"In this case, aside from the vulnerability being present for roughly a decade, sudo is a utility that is available by default in most Linux distributions – which makes for a huge potential footprint."

All that is required for an attacker to exploit the vulnerability is shell mode and the presence of a sudoers policy in an organization's Linux infrastructure, she says.

Shortridge says enterprises with a containerized production environment are somewhat protected against the bug.

"If an attacker successfully exploits this vulnerability, they will gain root access in the container but not in the underlying host itself," she notes.

Jai Vijayan is a seasoned technology reporter with over 20 years of experience in IT trade journalism. He was most recently a Senior Editor at Computerworld, where he covered information security and data privacy issues for the publication. Over the course of his 20-year ... View Full Bio

Recommended Reading:

Comment  | 
Print  | 
More Insights
Newest First  |  Oldest First  |  Threaded View
Former CISA Director Chris Krebs Discusses Risk Management & Threat Intel
Kelly Sheridan, Staff Editor, Dark Reading,  2/23/2021
Security + Fraud Protection: Your One-Two Punch Against Cyberattacks
Joshua Goldfarb, Director of Product Management at F5,  2/23/2021
Cybercrime Groups More Prolific, Focus on Healthcare in 2020
Robert Lemos, Contributing Writer,  2/22/2021
Register for Dark Reading Newsletters
White Papers
Cartoon Contest
Write a Caption, Win an Amazon Gift Card! Click Here
Latest Comment: This comment is waiting for review by our moderators.
Current Issue
2021 Top Enterprise IT Trends
We've identified the key trends that are poised to impact the IT landscape in 2021. Find out why they're important and how they will affect you today!
Flash Poll
Building the SOC of the Future
Building the SOC of the Future
Digital transformation, cloud-focused attacks, and a worldwide pandemic. The past year has changed the way business works and the way security teams operate. There is no going back.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2021-02-27
SerComm AG Combo VD625 AGSOT_2.1.0 devices allow CRLF injection (for HTTP header injection) in the download function via the Content-Disposition header.
PUBLISHED: 2021-02-27
An issue was discovered in through SaltStack Salt before 3002.5. salt.modules.cmdmod can log credentials to the info or error log level.
PUBLISHED: 2021-02-27
In SaltStack Salt before 3002.5, eauth tokens can be used once after expiration. (They might be used to run command against the salt master or minions.)
PUBLISHED: 2021-02-27
An issue was discovered in SaltStack Salt before 3002.5. Sending crafted web requests to the Salt API can result in salt.utils.thin.gen_thin() command injection because of different handling of single versus double quotes. This is related to salt/utils/thin.py.
PUBLISHED: 2021-02-27
i-doit before 1.16.0 is affected by Stored Cross-Site Scripting (XSS) issues that could allow remote authenticated attackers to inject arbitrary web script or HTML via C__MONITORING__CONFIG__TITLE, SM2__C__MONITORING__CONFIG__TITLE, C__MONITORING__CONFIG__PATH, SM2__C__MONITORING__CONFIG__PATH, C__M...