CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability
Reference page built from the source records below, each shown as its source publishes it. Dataset version ref-7da02a983b5d, updated 2026-11-02T23:39:54.475Z.
CISA Known Exploited Vulnerabilities
- Name
- Sudo Heap-Based Buffer Overflow Vulnerability
- Vendor
- Sudo
- Product
- Sudo
- Added to the catalog
- 2022-04-06
- Due date for US federal agencies
- 2022-04-27
- Weaknesses
- CWE-122, CWE-193
- Catalog version
- 2026.10.30
Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
Required action (CISA)
Apply updates per vendor instructions.
Ransomware use: CISA does not mark known use of this vulnerability in ransomware campaigns.
Links in CISA's notes
Read on 2026-11-02T23:39:54.475Z under licence cisa-kev-cc0@b0067899 from https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
NVD analysis
- Status
- Analyzed
- Published
- 2021-01-26T21:15:12.987
- Last modified
- 2026-06-17T04:04:45.830
- Weaknesses
- CWE-193
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.
| Metric | Score | Severity | Vector | Scored by |
|---|---|---|---|---|
| CVSS 3.1 | 7.8 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | [email protected] (Primary) |
| CVSS 3.1 | 7.8 | HIGH | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) |
| CVSS 2.0 | 7.2 | HIGH | AV:L/AC:L/Au:N/C:C/I:C/A:C | [email protected] (Primary) |
References
- 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)
- https://security.netapp.com/advisory/ntap-20210128-0001/ (Third Party Advisory)
- https://security.netapp.com/advisory/ntap-20210128-0002/ (Third Party Advisory)
- https://support.apple.com/kb/HT212177 (Third Party Advisory)
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM (Third Party Advisory)
- 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 (Third Party Advisory)
- https://www.debian.org/security/2021/dsa-4839 (Third Party Advisory)
- https://www.kb.cert.org/vuls/id/794544 (Third Party Advisory, US Government Resource)
- https://www.openwall.com/lists/oss-security/2021/01/26/3 (Exploit, Mailing List, Third Party Advisory)
- https://www.oracle.com//security-alerts/cpujul2021.html (Patch, Third Party Advisory)
- https://www.oracle.com/security-alerts/cpuapr2022.html (Patch, Third Party Advisory)
- https://www.oracle.com/security-alerts/cpuoct2021.html (Patch, Third Party Advisory)
- https://www.sudo.ws/stable.html#1.9.5p2 (Release Notes)
- https://www.synology.com/security/advisory/Synology_SA_21_02 (Third Party Advisory)
- https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156 (Exploit, Third Party Advisory)
- 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)
- https://security.netapp.com/advisory/ntap-20210128-0001/ (Third Party Advisory)
- https://security.netapp.com/advisory/ntap-20210128-0002/ (Third Party Advisory)
- https://support.apple.com/kb/HT212177 (Third Party Advisory)
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM (Third Party Advisory)
- 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 (Third Party Advisory)
- https://www.debian.org/security/2021/dsa-4839 (Third Party Advisory)
- https://www.kb.cert.org/vuls/id/794544 (Third Party Advisory, US Government Resource)
- https://www.openwall.com/lists/oss-security/2021/01/26/3 (Exploit, Mailing List, Third Party Advisory)
- https://www.oracle.com//security-alerts/cpujul2021.html (Patch, Third Party Advisory)
- https://www.oracle.com/security-alerts/cpuapr2022.html (Patch, Third Party Advisory)
- https://www.oracle.com/security-alerts/cpuoct2021.html (Patch, Third Party Advisory)
- https://www.sudo.ws/stable.html#1.9.5p2 (Release Notes)
- https://www.synology.com/security/advisory/Synology_SA_21_02 (Third Party Advisory)
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156 (US Government Resource)
This product uses the NVD API but is not endorsed or certified by the NVD.
Read on 2026-11-02T23:41:51.476Z under licence nvd-api-terms-of-use@ff2a5288 from https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2021-3156
CVE record
- Assigner
- mitre
- State
- PUBLISHED
- Published
- 2021-01-26T00:00:00.000Z
- Updated
- 2025-10-21T23:35:29.600Z
- Problem types
- n/a
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.
References
- [debian-lts-announce] 20210126 [SECURITY] [DLA 2534-1] sudo security update
- 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
- [oss-security] 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
- GLSA-202101-33
- DSA-4839
- FEDORA-2021-2cb63d912a
- FEDORA-2021-8840cbdccd
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
- 20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021
- VU#794544
- 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
- [oss-security] 20210215 Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedit
- 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
- 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()
- [oss-security] 20240130 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()
- 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()
- https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156
Read on 2026-11-03T01:07:54.531Z under licence cve-terms-of-use@81bfa2f3 from https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2021/3xxx/CVE-2021-3156.json
Detection rules (SigmaHQ)
SigmaHQ rules whose own tags name this CVE. Each rule page shows the rule as its author published it.
- CVE-2021-3156 Exploitation Attempt (status unsupported, level high)
- CVE-2021-3156 Exploitation Attempt Bruteforcing (status unsupported, level high)
Defensive techniques (MITRE D3FEND)
D3FEND maps these defensive techniques to the weakness (CWE) that NVD lists for this CVE, through the digital artifacts the weakness affects. D3FEND does not say they stop this vulnerability.
CWE-193: Off-by-one Error
D3FEND lists no defensive technique for this weakness.
D3FEND ontology version 1.6.0.
Read on 2026-11-02T23:55:08.615Z under licence d3fend-terms-of-use@f98cbc7e from https://d3fend.mitre.org/api/weakness/cwe/CWE-193.json
MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
"The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/
Sources and licences
CISA
Source: CISA Catalog of Known Exploited Vulnerabilities, version 2026.10.30, CC0 1.0. Use of this data does not imply endorsement by CISA or DHS.
National Vulnerability Database (NIST)
This product uses the NVD API but is not endorsed or certified by the NVD.
NVD API Terms of Use (NIST publications in the public domain, 17 U.S.C. 105)
CVE Program, The MITRE Corporation
Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation. CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
SigmaHQ
"CVE-2021-3156 Exploitation Attempt" by Bhabesh Raj (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/unsupported/linux/lnx_auditd_cve_2021_3156_sudo_buffer_overflow.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-LicenseSigmaHQ
"CVE-2021-3156 Exploitation Attempt Bruteforcing" by Bhabesh Raj (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/unsupported/linux/lnx_auditd_cve_2021_3156_sudo_buffer_overflow_brutforce.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-LicenseMITRE D3FEND
MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
"The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/MITRE D3FEND Terms of Use (site + knowledge graph); source repo MIT
Cite this page
Dragons Eye Ransomware Tracker, "CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability",
entity page, dataset version ref-7da02a983b5d, updated 2026-11-02T23:39:54.475Z,
https://ransomware-tracker.com/cve/CVE-2021-3156 (accessed 2026-11-03).
Underlying source: CISA Catalog of Known Exploited Vulnerabilities, version 2026.10.30.
Underlying source: National Vulnerability Database (NIST), CVE API 2.0, record last modified 2026-06-17T04:04:45.830.
Underlying source: CVE List (CVE Program, The MITRE Corporation), record updated 2025-10-21T23:35:29.600Z.
Underlying source: SigmaHQ rule 5ee37487-4eb8-4ac2-9be1-d7d14cdc559f, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Underlying source: SigmaHQ rule b9748c98-9ea7-4fdb-80b6-29bed6ba71d2, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Underlying source: MITRE D3FEND, ontology version 1.6.0.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.