# CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability

> CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability. CVSS 7.8 (CVSS 3.1), in CISA KEV.

Canonical: https://rewindex.com/cve/CVE-2021-3156
Last updated: 2025-10-21T23:35:29Z

- Published: 2021-01-26 00:00 UTC · Updated: 2025-10-21 23:35 UTC · Assigner: mitre
- CVSS: 7.8 (CVSS 3.1) · Severity: High · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 100.0%, 100th percentile (scored 2026-10-25)
- CISA KEV: yes, added 2022-04-06, federal due date 2022-04-27, ransomware use: Unknown

## 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.

## CISA required action

Apply updates per vendor instructions.

## Affected vendors and products

- Sudo: Sudo

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2021-3156)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2021-3156)
- [http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html](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/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/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/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html)
- [http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-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/Feb/42)
- [http://seclists.org/fulldisclosure/2021/Jan/79](http://seclists.org/fulldisclosure/2021/Jan/79)
- [http://seclists.org/fulldisclosure/2024/Feb/3](http://seclists.org/fulldisclosure/2024/Feb/3)
- [https://kc.mcafee.com/corporate/index?page=content&id=SB10348](https://kc.mcafee.com/corporate/index?page=content&id=SB10348)
- [https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html](https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html)
- [https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/](https://lists.fedoraproject.org/archives/list/package-announce%2540lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/)
- [https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/](https://lists.fedoraproject.org/archives/list/package-announce%2540lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/)
- [https://security.gentoo.org/glsa/202101-33](https://security.gentoo.org/glsa/202101-33)
- [https://security.netapp.com/advisory/ntap-20210128-0001/](https://security.netapp.com/advisory/ntap-20210128-0001/)
- [https://security.netapp.com/advisory/ntap-20210128-0002/](https://security.netapp.com/advisory/ntap-20210128-0002/)
- [https://support.apple.com/kb/HT212177](https://support.apple.com/kb/HT212177)
- [https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM](https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM)
- [https://www.beyondtrust.com/blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability](https://www.beyondtrust.com/blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability)
- [https://www.debian.org/security/2021/dsa-4839](https://www.debian.org/security/2021/dsa-4839)
- [https://www.kb.cert.org/vuls/id/794544](https://www.kb.cert.org/vuls/id/794544)
- [https://www.openwall.com/lists/oss-security/2021/01/26/3](https://www.openwall.com/lists/oss-security/2021/01/26/3)
- [https://www.oracle.com/security-alerts/cpuapr2022.html](https://www.oracle.com/security-alerts/cpuapr2022.html)
- [https://www.oracle.com//security-alerts/cpujul2021.html](https://www.oracle.com//security-alerts/cpujul2021.html)
- [https://www.oracle.com/security-alerts/cpuoct2021.html](https://www.oracle.com/security-alerts/cpuoct2021.html)
- [https://www.sudo.ws/stable.html\#1.9.5p2](https://www.sudo.ws/stable.html#1.9.5p2)
- [https://www.synology.com/security/advisory/Synology\_SA\_21\_02](https://www.synology.com/security/advisory/Synology_SA_21_02)
- [https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156](https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156)
- [http://www.openwall.com/lists/oss-security/2021/01/26/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/1)
- [http://www.openwall.com/lists/oss-security/2021/01/27/2](http://www.openwall.com/lists/oss-security/2021/01/27/2)
- [http://www.openwall.com/lists/oss-security/2021/02/15/1](http://www.openwall.com/lists/oss-security/2021/02/15/1)
- [http://www.openwall.com/lists/oss-security/2021/09/14/2](http://www.openwall.com/lists/oss-security/2021/09/14/2)
- [http://www.openwall.com/lists/oss-security/2024/01/30/6](http://www.openwall.com/lists/oss-security/2024/01/30/6)
- [http://www.openwall.com/lists/oss-security/2024/01/30/8](http://www.openwall.com/lists/oss-security/2024/01/30/8)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2021-3156 · Markdown: https://rewindex.com/cve/CVE-2021-3156.md · JSON: https://rewindex.com/api/v1/cves/CVE-2021-3156 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T02:14:38.768Z
