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
FluBot Malware's Rapid Spread May Soon Hit US Phones
Kelly Sheridan, Staff Editor, Dark Reading,  4/28/2021
7 Modern-Day Cybersecurity Realities
Steve Zurier, Contributing Writer,  4/30/2021
How to Secure Employees' Home Wi-Fi Networks
Bert Kashyap, CEO and Co-Founder at SecureW2,  4/28/2021
Register for Dark Reading Newsletters
White Papers
Cartoon Contest
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
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
PUBLISHED: 2021-05-06
An SSRF issue in Open Distro for Elasticsearch (ODFE) before allows an existing privileged user to enumerate listening services or interact with configured resources via HTTP requests exceeding the Alerting plugin's intended scope.
PUBLISHED: 2021-05-06
Arbitrary File Deletion vulnerability in puppyCMS v5.1 allows remote malicious attackers to delete the file/folder via /admin/functions.php.
PUBLISHED: 2021-05-06
Rmote Code Execution (RCE) vulnerability in puppyCMS v5.1 due to insecure permissions, which could let a remote malicious user getshell via /admin/functions.php.
PUBLISHED: 2021-05-06
An issue exists on NightOwl WDB-20-V2 WDB-20-V2_20190314 devices that allows an unauthenticated user to gain access to snapshots and video streams from the doorbell. The binary app offers a web server on port 80 that allows an unauthenticated user to take a snapshot from the doorbell camera via the ...
PUBLISHED: 2021-05-06
An out-of-bounds (OOB) memory write flaw was found in list_devices in drivers/md/dm-ioctl.c in the Multi-device driver module in the Linux kernel before 5.12. A bound check failure allows an attacker with special user (CAP_SYS_ADMIN) privilege to gain access to out-of-bounds memory leading to a syst...