What’s Vulnerable › Vulnerabilities
CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability
- Severity: high (CVSS 7.8 v3.1)
- Exploited in the wild: yes — in CISA KEV since 2022-04-06
- EPSS: 100.0% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-01-26 · updated 2026-06-17
- Weakness: CWE-193
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.
Affected products
- BeyondTrust Privilege Management For Mac: before 21.1.1 — fixed in 21.1.1
- BeyondTrust Privilege Management For Unix/Linux: before 10.3.2-10 — fixed in 10.3.2-10
- Debian Linux: 9.0, 10.0
- Fedoraproject Fedora: 32, 33
- McAfee Web Gateway (MWG): 8.2.17, 9.2.8, 10.0.4
- Active IQ Unified Manager for VMware vSphere, Linux, and Microsoft Windows: all versions
- NetApp Cloud Backup: all versions
- NetApp Hci Management Node: all versions
- NetApp Oncommand Unified Manager Core Package: all versions
- NetApp ONTAP Select Deploy administration utility: all versions
- NetApp Ontap Tools: 9
- NetApp Solidfire: all versions
- Oracle Communications Performance Intelligence Center: from 10.3.0.0.0 through 10.3.0.2.1; from 10.4.0.1.0 through 10.4.0.3.1
- Oracle Micros Compact Workstation 3 Firmware: 310
- Oracle Micros Es400 Firmware: from 400 through 410
- Oracle Micros Kitchen Display System Firmware: 210
- Oracle Micros Workstation 5A Firmware: 5a
- Oracle Micros Workstation 6 Firmware: from 610 through 655
- Oracle Tekelec Platform Distribution: from 7.4.0 through 7.7.1
- sudo: from 1.8.2 before 1.8.32; from 1.9.0 before 1.9.5; 1.9.5, 1.9.5-patch1 — fixed in 1.8.32, 1.9.5
- Synology DiskStation Manager: 6.2
- Synology Diskstation Manager Unified Controller: 3.0
- Synology Skynas Firmware: all versions
- Synology Vs960Hd Firmware: all versions
How to fix
Upgrade to a fixed version: BeyondTrust Privilege Management For Mac 21.1.1; BeyondTrust Privilege Management For Unix/Linux 10.3.2-10; sudo 1.8.32, 1.9.5. Check the vendor advisory for mitigations.
References
- http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
- http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html
- http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html
- http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html
- http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- http://seclists.org/fulldisclosure/2021/Feb/42
- http://seclists.org/fulldisclosure/2021/Jan/79
- http://seclists.org/fulldisclosure/2024/Feb/3
- http://www.openwall.com/lists/oss-security/2021/01/26/3
- http://www.openwall.com/lists/oss-security/2021/01/27/1
- http://www.openwall.com/lists/oss-security/2021/01/27/2
- http://www.openwall.com/lists/oss-security/2021/02/15/1
Get alerted when CVE-2021-3156 or the next vulnerability affects your stack