Home / Sudo Project / Sudo / CVE-2021-3156
CVE-2021-3156: is it exploited, and which versions of Sudo Project Sudo are affected and fixed?
CVE-2021-3156 is an off-by-one Error vulnerability in Sudo Project Sudo, and it is exploited in the wild: CISA added it to its Known Exploited Vulnerabilities catalog on April 6, 2022, with a federal due date of April 27, 2022. Affected: sudo from 1.8.2 before 1.8.32, sudo from 1.9.0 before 1.9.5, sudo 1.9.5 and 28 more (NVD). Fixed in 1.8.32, 1.9.5, 21.1.1 and 10.3.2-10 (NVD). Severity: High (7.8, CVSS 3.1, from CISA-ADP).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 14:08 UTC, CVE record November 19, 2026, 07:15 UTC and NVD November 19, 2026, 08:04 UTC.
What is CVE-2021-3156?
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.
From the CVE record by mitre, last updated October 21, 2025, 23:35 UTC.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| sudo project | sudo | from 1.8.2 before 1.8.32 | application |
| sudo project | sudo | from 1.9.0 before 1.9.5 | application |
| sudo project | sudo | 1.9.5 | application |
| fedoraproject | fedora | 32 | operating system |
| fedoraproject | fedora | 33 | operating system |
| debian | debian linux | 9.0 | operating system |
| debian | debian linux | 10.0 | operating system |
| netapp | active iq unified manager | all versions | application |
| netapp | cloud backup | all versions | application |
| netapp | hci management node | all versions | application |
| netapp | oncommand unified manager core package | all versions | application |
| netapp | ontap select deploy administration utility | all versions | application |
| netapp | ontap tools | 9 | application |
| netapp | solidfire | all versions | application |
| mcafee | web gateway | 8.2.17 | application |
| mcafee | web gateway | 9.2.8 | application |
| mcafee | web gateway | 10.0.4 | application |
| synology | diskstation manager unified controller | 3.0 | application |
| synology | diskstation manager | 6.2 | operating system |
| synology | skynas firmware | all versions | operating system |
| synology | vs960hd firmware | all versions | operating system |
| beyondtrust | privilege management for mac | before 21.1.1 | application |
| beyondtrust | privilege management for unix\/linux | before 10.3.2-10 | application |
| oracle | micros compact workstation 3 firmware | 310 | operating system |
| oracle | micros es400 firmware | from 400 through 410 | operating system |
NVD analysis (status Analyzed), last modified June 17, 2026, 04:04 UTC.
How severe is CVE-2021-3156?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 7.8 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | CISA-ADP |
| High 7.8 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NVD |
| High 7.2 | CVSS 2.0 | AV:L/AC:L/Au:N/C:C/I:C/A:C | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2021-3156 exploited in the wild?
- CISA KEV
- Listed as Sudo Heap-Based Buffer Overflow Vulnerability, added April 6, 2022; federal agencies must act by April 27, 2022
- Required action
- Apply updates per vendor instructions.
- Ransomware use
- Unknown
- CISA's summary
- Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
- CISA SSVC
- Exploitation: active; automatable: no; technical impact: total (CISA ADP, February 3, 2025)
- EPSS
- 100.0% probability of exploitation activity in the next 30 days, percentile 100.0 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
- CWE-193 Off-by-one Error
Where are the vendor advisories and references?
- [debian-lts-announce] 20210126 [SECURITY] [DLA 2534-1] sudo security update mailing-list
- 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) mailing-list
- [oss-security] 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) mailing-list
- GLSA-202101-33 vendor-advisory
- DSA-4839 vendor-advisory
- FEDORA-2021-2cb63d912a vendor-advisory
- FEDORA-2021-8840cbdccd vendor-advisory
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) mailing-list
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) mailing-list
- 20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021 vendor-advisory
- VU#794544 third-party-advisory
- 20210211 APPLE-SA-2021-02-09-1 macOS Big Sur 11.2.1, macOS Catalina 10.15.7 Supplemental Update, and macOS Mojave 10.14.6 Security Update 2021-002 mailing-list
- [oss-security] 20210215 Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedit mailing-list
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.sudo.ws/stable.html#1.9.5p2
- https://www.openwall.com/lists/oss-security/2021/01/26/3
- http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
- https://security.netapp.com/advisory/ntap-20210128-0002/
- https://security.netapp.com/advisory/ntap-20210128-0001/
- 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
- https://support.apple.com/kb/HT212177
- https://kc.mcafee.com/corporate/index?page=content&id=SB10348
- 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.synology.com/security/advisory/Synology_SA_21_02
- [oss-security] 20210914 Re: Oracle Solaris membership in the distros list mailing-list
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- [oss-security] 20240130 Re: CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() mailing-list
- [oss-security] 20240130 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() mailing-list
- http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- 20240204 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() mailing-list
- https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156 government-resource
When was it published, and where is the official record?
- Reserved
- January 15, 2021
- Published
- January 26, 2021, 00:00 UTC
- CVE record updated
- October 21, 2025, 23:35 UTC by mitre
- NVD
- Analyzed, last modified June 17, 2026, 04:04 UTC
- Last checked
- CVE list November 19, 2026, 07:15 UTC; NVD November 19, 2026, 08:04 UTC; KEV December 3, 2026, 14:08 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD · CISA KEV
What other CVEs affect Sudo?
- Jun 30, 2025CVE-2025-32463 Sudo project Sudo: inclusion of code from an untrusted source exploited
- Aug 29, 2026CVE-2026-82474 sudo-project sudo: protection mechanism failure
- Apr 3, 2026CVE-2026-35535 Sudo project Sudo: privilege Dropping / Lowering Errors
- Jun 30, 2025CVE-2025-32462 Sudo project Sudo: incorrect authorization
- Dec 22, 2023CVE-2023-42465 Sudo Project Sudo: n/a
- Mar 16, 2023CVE-2023-28487 Sudo Project Sudo: improper output encoding
- Mar 16, 2023CVE-2023-28486 Sudo Project Sudo: improper output encoding
- Feb 28, 2023CVE-2023-27320 Sudo Project Sudo: double free
Questions about CVE-2021-3156
Is CVE-2021-3156 exploited in the wild?
Yes. CISA added CVE-2021-3156 to its Known Exploited Vulnerabilities catalog on April 6, 2022 and set federal agencies a due date of April 27, 2022. FIRST's EPSS gives it a 100.0% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of Sudo Project Sudo are affected by CVE-2021-3156?
sudo from 1.8.2 before 1.8.32, sudo from 1.9.0 before 1.9.5, sudo 1.9.5, fedora 32, fedora 33, debian linux 9.0 and 25 more, per the NVD. The tables above give every range the sources list.
Which version fixes CVE-2021-3156?
1.8.32, 1.9.5, 21.1.1 and 10.3.2-10, per the NVD. Check the vendor's advisory before you rely on it.
How severe is CVE-2021-3156?
High (7.8, CVSS 3.1, from CISA-ADP). The severity table above shows each score with its source.
Where is the official record of CVE-2021-3156?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov; CISA's entry is in its Known Exploited Vulnerabilities catalog. For a fix, the vendor's own advisory is the one to follow.