CVEs / CVE-2021-3156
CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability
- Known exploited in the CISA KEV catalog since 6 Apr 2022
- high 7.8 CVSS 3.1 (NVD)
- EPSS 99.9% chance of exploitation in the next 30 days, higher than 99% of CVEs (30 Oct 2026)
- Last changed at its sources
Are you affected? Check your servers with Stackurity: it lists the software on each server and the vulnerabilities to fix first.
Check your servers with Stackurity Already using Stackurity? Search for CVE-2021-3156
Summary
Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
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 and fixed versions
| Product | Affected | Fixed in |
|---|---|---|
| n/a n/a | n/a | — |
Exploitation
| In CISA KEV since | 6 Apr 2022 |
|---|---|
| Due date for US federal agencies | 27 Apr 2022 |
| Used in ransomware campaigns | Unknown |
| Required action | Apply updates per vendor instructions. |
Severity
| CVSS 3.1 | 7.8 highCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HScored by NVD |
|---|---|
| Weakness | CWE-193 |
References
- CVE-2021-3156 on NVD
- CVE-2021-3156 in the CISA KEV catalog
- CVE-2021-3156 on OSV
- http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html Exploit, Third Party Advisory, VDB Entry
- http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html Exploit, Third Party Advisory, VDB Entry
- http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html Exploit, Third Party Advisory, VDB Entry
- http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html Exploit, Third Party Advisory, VDB Entry
- http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html Exploit, Third Party Advisory, VDB Entry
- http://seclists.org/fulldisclosure/2021/Feb/42 Mailing List, Third Party Advisory
- http://seclists.org/fulldisclosure/2021/Jan/79 Exploit, Mailing List, Third Party Advisory
- http://seclists.org/fulldisclosure/2024/Feb/3 Exploit, Mailing List, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2021/01/26/3 Exploit, Mailing List, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2021/01/27/1 Mailing List, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2021/01/27/2 Mailing List, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2021/02/15/1 Exploit, Mailing List, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2021/09/14/2 Mailing List, Patch, Third Party Advisory
- http://www.openwall.com/lists/oss-security/2024/01/30/6 Exploit, Mailing List
- http://www.openwall.com/lists/oss-security/2024/01/30/8 Mailing List
- https://kc.mcafee.com/corporate/index?page=content&id=SB10348 Broken Link, Third Party Advisory
- https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html Mailing List, Third Party Advisory
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/ Mailing List, Release Notes
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/ Mailing List, Release Notes
- https://security.gentoo.org/glsa/202101-33 Third Party Advisory
Sources
Exploitation status from the CISA Known Exploited Vulnerabilities catalog. EPSS scores from FIRST. Descriptions, severity and references from the National Vulnerability Database. Open-source package versions from OSV (CC-BY 4.0). Text is shown as each source states it; Stackurity does not edit it. Check the vendor's advisory before acting.
This product uses data from the NVD API but is not endorsed or certified by the NVD.