Very High
CVE-2021-3156 "Baron Samedit"
CVE ID
AttackerKB requires a CVE ID in order to pull vulnerability data and references from the CVE list and the National Vulnerability Database. If available, please supply below:
Add References:
CVE-2021-3156 "Baron Samedit"
MITRE ATT&CK
Collection
Command and Control
Credential Access
Defense Evasion
Discovery
Execution
Exfiltration
Impact
Initial Access
Lateral Movement
Persistence
Privilege Escalation
Topic Tags
Description
Sudo before 1.9.5p2 contains an off-by-one error that can result in a heap-based buffer overflow, which allows privilege escalation to root via “sudoedit -s” and a command-line argument that ends with a single backslash character.
Add Assessment
Ratings
-
Attacker ValueVery High
-
ExploitabilityVery High
Technical Analysis
Sudo is vulnerable to a local privilege escalation that enables any local user to gain root privileges. This is due to a heap-based buffer overflow when unescaping backslashes in the command’s arguments. This vulnerable code has been introduced in July 2011. According to the advisory, legacy versions from 1.8.2 to 1.8.31p2 and stable versions from 1.9.0 to 1.9.5p1 are vulnerable in their default configurations. Note that the local user password is not required to successfully exploit this vulnerability.
The exploitation is done by invoking “sudoedit -s” command to reach the vulnerable code and do an out-of-bounds write in heap memory. The security researchers were able to exploit this vulnerability and get a shell as root using 3 different methods. One of them, which seems to be the easiest and the most reliable, is demo’ed in this video.
I couldn’t find any PoC available, but there are enough technical details in the advisory to write an exploit. It is a critical bug and sudo should be patched immediately. It is very likely a working exploit will be publicly available soon.
Would you also like to delete your Exploited in the Wild Report?
Delete Assessment Only Delete Assessment and Exploited in the Wild ReportRatings
-
Attacker ValueVery High
-
ExploitabilityVery High
Technical Analysis
Proof of Concept
https://github.com/lockedbyte/CVE-Exploits/tree/master/CVE-2021-3156
Would you also like to delete your Exploited in the Wild Report?
Delete Assessment Only Delete Assessment and Exploited in the Wild ReportRatings
-
Attacker ValueVery High
-
ExploitabilityVery High
Would you also like to delete your Exploited in the Wild Report?
Delete Assessment Only Delete Assessment and Exploited in the Wild ReportRatings
-
Attacker ValueLow
-
ExploitabilityLow
Would you also like to delete your Exploited in the Wild Report?
Delete Assessment Only Delete Assessment and Exploited in the Wild ReportCVSS V3 Severity and Metrics
General Information
Vendors
- beyondtrust,
- debian,
- fedoraproject,
- mcafee,
- netapp,
- oracle,
- sudo project,
- synology
Products
- active iq unified manager -,
- cloud backup -,
- communications performance intelligence center,
- debian linux 10.0,
- debian linux 9.0,
- diskstation manager 6.2,
- diskstation manager unified controller 3.0,
- fedora 32,
- fedora 33,
- hci management node -,
- micros compact workstation 3 firmware 310,
- micros es400 firmware,
- micros kitchen display system firmware 210,
- micros workstation 5a firmware 5a,
- micros workstation 6 firmware,
- oncommand unified manager core package -,
- ontap select deploy administration utility -,
- ontap tools 9,
- privilege management for mac,
- privilege management for unix/linux,
- skynas firmware -,
- solidfire -,
- sudo,
- sudo 1.9.5,
- tekelec platform distribution,
- vs960hd firmware -,
- web gateway 10.0.4,
- web gateway 8.2.17,
- web gateway 9.2.8
Exploited in the Wild
Would you like to delete this Exploited in the Wild Report?
Yes, delete this reportWould you like to delete this Exploited in the Wild Report?
Yes, delete this reportWould you like to delete this Exploited in the Wild Report?
Yes, delete this reportReferences
Advisory
Miscellaneous
Additional Info
Technical Analysis
Description
On Tuesday, January 26, 2021, the Qualys Research Team published a blog post on CVE-2021-3156, a privilege escalation vulnerability in the sudo
command that enables any local user to gain root privileges without using a password, even if the user is not listed in the sudoers
file. The vulnerability arises from a heap-based buffer overflow when unescaping backslashes in a supplied command’s arguments. The vulnerable code was introduced in July 2011 and affects most Linux-based operating systems. See the project maintainers’ advisory on the vulnerability for further details.
Affected Products
According to the advisory, legacy versions of sudo
from 1.8.2 to 1.8.31p2 and stable versions from 1.9.0 to 1.9.5p1 are vulnerable in their default configurations. Depending on the Linux distribution, the version number might be different. Please check the Guidance section for details.
Rapid7 analysis
CVE-2021-3156 is a local privilege escalation vulnerability, which means an attacker requires existing access to a target (such as through remote code execution) in order to exploit the bug. Exploitation is achieved by invoking the sudoedit -s
command to reach the vulnerable code and perform an out-of-bounds (OOB) write in heap memory. Upon successful exploitation, the attacker would gain root access, resulting in full compromise of the system.
At the time of this writing, a crash PoC is available from Qualys. Rapid7 researchers have reliably reproduced the crash using the supplied PoC. The advisory contains enough technical detail to develop the PoC into an exploit. Researchers will have to bypass any memory protections in place, though the bug allows for a great amount of control over the OOB write, reducing the burden of exploitation. It is only a matter of time before exploits begin to surface.
Guidance
Rapid7 recommends that sudo
users update to version 1.9.5p2 immediately. The legacy release stream 1.8.x has not yet received a critical bug fix for CVE-2021-3156. There is no effective mitigation for this vulnerability. Patched versions are listed below.
Official maintainer:
- Stable release has been patched in version 1.9.5p2: https://github.com/sudo-project/sudo/releases/tag/SUDO_1_9_5p2
- Legacy release has not been patched already: https://www.sudo.ws/legacy.html
Linux distributions:
- Ubuntu: https://ubuntu.com/security/CVE-2021-3156
- Debian: https://security-tracker.debian.org/tracker/CVE-2021-3156
- RHEL: https://access.redhat.com/security/cve/CVE-2021-3156
- Fedora: https://bodhi.fedoraproject.org/updates/FEDORA-2021-2cb63d912a
- Arch Linux: https://security.archlinux.org/CVE-2021-3156
- Gentoo: https://security.gentoo.org/glsa/202101-33
References
Report as Emergent Threat Response
Report as Exploited in the Wild
CVE ID
AttackerKB requires a CVE ID in order to pull vulnerability data and references from the CVE list and the National Vulnerability Database. If available, please supply below: