CVE-2021-3156
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.
Severity
HIGH
CVSS v3
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H · source nvd
Exploit chance (EPSS)
99.962%
chance of exploitation in the next 30 days
among the highest of scored CVEs · 2026-11-17
CISA KEV
Listed
added 2022-04-06
Public exploit code
Yes
Exploit references (NVD and CNA): 12
Metasploit modules: 1
Nuclei templates: 0
Exploit-DB: 2
Weakness
- CWE-193: Off-by-one Error
CISA Known Exploited Vulnerabilities entry
| Vulnerability name | Sudo Heap-Based Buffer Overflow Vulnerability |
|---|---|
| Vendor / product | Sudo / Sudo |
| Date added | 2022-04-06 |
| Federal remediation due date | 2022-04-27 |
| Required action | Apply updates per vendor instructions. |
| Known ransomware campaign use | Unknown |
CISA SSVC decision points
| Exploitation | active |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2025-02-03 |
Timeline
- 2021-01-26Published by the CNA00:00 UTC
- 2021-02-03First Exploit-DB entry (EDB-ID 49521)8 days after publication
- 2022-04-06Added to the CISA KEV catalog435 days after publication
- 2025-02-03CISA SSVC decision recorded1469 days after publication
Exploit and advisory records
| Exploit-DB | Type | Platform | Published | EDB-verified |
|---|---|---|---|---|
| EDB-ID 49522 | local | multiple | 2021-02-03 | no |
| EDB-ID 49521 | local | multiple | 2021-02-03 | no |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| sudo_project sudo | from 1.8.2 before 1.8.32fixed in 1.8.32from 1.9.0 before 1.9.5fixed in 1.9.51.9.5no fix listed | 1.8.321.9.5not listed |
| beyondtrust privilege_management_for_mac | before 21.1.1fixed in 21.1.1 | 21.1.1 |
| beyondtrust privilege_management_for_unix/linux | before 10.3.2-10fixed in 10.3.2-10 | 10.3.2-10 |
| debian debian_linux | 10.0no fix listed9.0no fix listed | not listednot listed |
| fedoraproject fedora | 32no fix listed33no fix listed | not listednot listed |
| mcafee web_gateway | 10.0.4no fix listed8.2.17no fix listed9.2.8no fix listed | not listednot listednot listed |
| netapp active_iq_unified_manager | ||
| netapp cloud_backup | ||
| netapp hci_management_node | ||
| netapp oncommand_unified_manager_core_package | ||
| netapp ontap_select_deploy_administration_utility | ||
| netapp ontap_tools | 9no fix listed | not listed |
| netapp solidfire | ||
| oracle communications_performance_intelligence_center | from 10.3.0.0.0 through 10.3.0.2.1no fix listedfrom 10.4.0.1.0 through 10.4.0.3.1no fix listed | not listednot listed |
| oracle micros_compact_workstation_3_firmware | 310no fix listed | not listed |
| oracle micros_es400_firmware | from 400 through 410no fix listed | not listed |
| oracle micros_kitchen_display_system_firmware | 210no fix listed | not listed |
| oracle micros_workstation_5a_firmware | 5ano fix listed | not listed |
| oracle micros_workstation_6_firmware | from 610 through 655no fix listed | not listed |
| oracle tekelec_platform_distribution | from 7.4.0 through 7.7.1no fix listed | not listed |
References
- http://www.openwall.com/lists/oss-security/2021/09/14/2
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/
- https://security.gentoo.org/glsa/202101-33
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM
- https://www.debian.org/security/2021/dsa-4839
- 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/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/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- http://seclists.org/fulldisclosure/2021/Jan/79
- http://seclists.org/fulldisclosure/2024/Feb/3
- http://www.openwall.com/lists/oss-security/2021/01/26/3
- http://www.openwall.com/lists/oss-security/2021/02/15/1
- http://www.openwall.com/lists/oss-security/2024/01/30/6
- https://www.openwall.com/lists/oss-security/2021/01/26/3
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2021-3156'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2021-3156'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2021-3156'curl 'https://api.contrastcyber.com/cve_products/CVE-2021-3156'curl 'https://api.contrastcyber.com/kev_lookup/CVE-2021-3156'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).