CVE-2021-3156
Sudo Heap-Based Buffer Overflow Vulnerability
- Actively exploited
- High · 7.8 of 10
- Exploited since
- 6 Apr 2022 added to the CISA list
- Chance of attacks
- over 99.9% in the next 30 days (FIRST EPSS)
- Fix deadline
- 27 Apr 2022 for US federal agencies
- Published
- 26 Jan 2021 in the NVD
What this means
Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
CISA
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.
NIST National Vulnerability Database
What to do
Apply updates per vendor instructions.
CISA's required action. If you use the product, install the vendor's update as soon as possible.
Affected
- n/a n/a
Official sources
- nvd.nist.gov/vuln/detail/CVE-2021-3156
- packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
- packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html
- packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.htm...
- packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html
- packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- seclists.org/fulldisclosure/2021/Feb/42
- seclists.org/fulldisclosure/2021/Jan/79
- seclists.org/fulldisclosure/2024/Feb/3
Data from the NIST National Vulnerability Database, the CISA Known Exploited Vulnerabilities list, FIRST EPSS and ENISA, checked 19 Nov 2026. CVSS vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.