CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability
Vulnerability summary
CVE-2021-3156 is a high (CVSS 7.8) Off-by-one Error vulnerability in Sudo. It is known to be exploited: CISA lists it, first on 06-04-2022. EPSS estimates a 99.96% chance of exploitation in the next 30 days, higher than 99.9% of scored vulnerabilities. 15 public exploits are recorded.
Advisory lineage
Upstream 0 · Downstream 10 · Related 8Timeline
- 26-01-2021PublishedVulnerability first disclosed.
- 06-04-2022Added to CISA KEVSudo Heap-Based Buffer Overflow Vulnerability
- 27-04-2022CISA remediation dueApply updates per vendor instructions.
- 21-10-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 6 sources · 2 versions- OSV · AlpineEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · Red hatEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · UbuntuEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- NVDNIST7.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
99.96%
Chance of exploitation in the next 30 days
Percentile
100%
Versus all other CVEs
30-day change
-0.01 pp
From 99.97% on 18-09-2026
Known exploited
Compare KEV catalogs- Added
- 06-04-2022
- Federal due date
- 27-04-2022
CISA required action
Apply updates per vendor instructions. nvd.nist.gov/vuln/detail/CVE-2021-3156
Public exploits
15 foundExploit Reference (seclists.org)
Maturity: unknown
Exploit Reference (openwall.com)
Maturity: unknown
Exploit Reference (openwall.com)
Maturity: unknown
Show all 15 exploits
Exploit Reference (openwall.com)
Maturity: unknown
Exploit Reference (packetstormsecurity.com)
Maturity: unknown
Exploit Reference (packetstormsecurity.com)
Maturity: unknown
Exploit Reference (packetstormsecurity.com)
Maturity: unknown
Exploit Reference (packetstormsecurity.com)
Maturity: unknown
Exploit Reference (openwall.com)
Maturity: unknown
Exploit Reference (packetstormsecurity.com)
Maturity: unknown
Exploit Reference (seclists.org)
Maturity: unknown
Exploit Reference (vicarius.io)
Maturity: unknown
Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)
Maturity: poc
Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)
Maturity: poc
Sudo Heap-Based Buffer Overflow
exploit/linux/local/sudo_baron_samedit
Maturity: weaponized
Weaknesses
CWE · root causeAffected systems
Suse34 products
- sudo&distro=HPE Helion OpenStack 8< 1.8.20p2-3.23.1
- sudo&distro=SUSE Enterprise Storage 6< 1.8.22-4.18.1
- sudo&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS< 1.8.22-4.18.1
- sudo&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS< 1.8.22-4.18.1
- sudo&distro=SUSE Linux Enterprise High Performance Computing 15-ESPOS< 1.8.22-4.18.1
Netapp7 products
- active_iq_unified_managerna
- cloud_backupna
- hci_management_nodena
- oncommand_unified_manager_core_packagena
- ontap_select_deploy_administration_utilityna
Oracle7 products
- communications_performance_intelligence_center≥ 10.3.0.0.0, ≤ 10.3.0.2.1 | ≥ 10.4.0.1.0, ≤ 10.4.0.3.1
- micros_compact_workstation_3_firmware310
- micros_es400_firmware≥ 400, ≤ 410
- micros_kitchen_display_system_firmware210
- micros_workstation_5a_firmware5a
Redhat4 products
- sudo< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2 | < 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
- sudo-debuginfo< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2 | < 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
- sudo-debugsource< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2
- sudo-devel< 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
Synology4 products
Beyondtrust2 products
- privilege_management_for_mac< 21.1.1
- privilege_management_for_unix\/linux< 10.3.2-10
Debian2 products
- sudo< 1.9.5p1-1.1 | < 1.8.27-1+deb10u3 | < 1.8.19p1-2.1+deb9u3
- debian_linuxEOL9.0 | 10.0
Alpine1 product
- sudo≥ 1.8.2, < 1.9.5p2-r0 | ≥ 1.8.2, < 1.8.31-r1
Fedoraproject1 product
- fedoraEOL32 | 33
Mageia1 product
- sudo< 1.9.5p2-1.mga7
Mcafee1 product
- web_gateway8.2.17 | 9.2.8 | 10.0.4
Opensuse1 product
- sudo&distro=openSUSE Leap 15.2< 1.8.22-lp152.8.9.1
Sudo_project1 product
- sudo≥ 1.8.2, < 1.8.32 | ≥ 1.9.0, < 1.9.5 | 1.9.5 | 1.9.5:patch1
Ubuntu1 product
- sudo< 1.8.9p5-1ubuntu1.5+esm6 | < 1.8.16-0ubuntu1.10 | < 1.8.21p2-3ubuntu1.4 | < 1.8.31-1ubuntu1.2
14 vendors · 67 products
References
82 links- tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcMVendor AdvisoryThird Party Advisory
Show all 82 references
- www.sudo.ws/stable.htmlRelease Notes
- packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.htmlExploitThird Party AdvisoryVDB Entry
- security.netapp.com/advisory/ntap-20210128-0002/Third Party Advisory
- security.netapp.com/advisory/ntap-20210128-0001/Third Party Advisory
- packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.htmlExploitThird Party AdvisoryVDB Entry
- packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.htmlExploitThird Party AdvisoryVDB Entry
- packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.htmlExploitThird Party AdvisoryVDB Entry
- support.apple.com/kb/HT212177Third Party Advisory
- www.beyondtrust.com/blog/…Third Party Advisory
- www.synology.com/security/advisory/Synology_SA_21_02Third Party Advisory
- www.openwall.com/lists/oss-security/2024/01/30/8Mailing List
- packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.htmlExploitThird Party AdvisoryVDB Entry
- www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156Government ResourceUS Government Resource
- lists.opensuse.org/archives/…Advisory