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
02 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
03 Exploitation and scoring
- Exploitation
- Exploited in the wild. Listed in the CISA Known Exploited Vulnerabilities catalog on 2022-04-06. Federal remediation due 2022-04-27.
- SSVC decision
- ExploitationactiveCISA reports credible evidence of active exploitation.
- AutomatablenoAt least one step from reconnaissance to exploitation cannot be reliably automated.
- Technical ImpacttotalSuccessful exploitation gives total control of the vulnerable component.
- EPSS probability
- 99.96% probability of exploitation activity in the next 30 days.
- EPSS percentile
- Equal to or higher than the score of 99.9% of scored records. A rank, not a probability.
- NVD base score
- 7.8 (CVSS v3.x), scored by the NVD independently of the CNA.
- NVD CVSS vector
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- NVD analysis status
- Analyzed. NVD last modified this record on 2026-06-17.
- Red Hat severity
- Important. Red Hat's rating for its own products, not a CVSS rating.
Exploit-prediction scores from FIRST. Independent scoring and analysis status from the NVD. Vendor severity from Red Hat. Exploitation assessment and catalog membership from CISA.
04 Metadata
- Published
- 2021-01-26 00:00Z5 YR AGO
- Last updated
- 2025-10-21 23:35Z1 YR AGO
- Reserved
- 2021-01-15
- Assigning CNA
- mitre
- Record state
- PUBLISHED
- Severity
- High (CVSS 7.8)
- CNA CVSS vector
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- Data version
- 5.1
- Document digest
- e60a9d31942b816ae37b34acfb7db6b3297f620d3425d35ada952cbc44f0f048
05 Affected products
06 References
- lists.debian.org[debian-lts-announce] 20210126 [SECURITY] [DLA 2534-1] sudo security updatehttps://lists.debian.org/debian-lts-announce/2021/01/msg00022.html
- seclists.org20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)http://seclists.org/fulldisclosure/2021/Jan/79
- www.openwall.com[oss-security] 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)http://www.openwall.com/lists/oss-security/2021/01/26/3
- security.gentoo.orgGLSA-202101-33https://security.gentoo.org/glsa/202101-33
- www.debian.orgDSA-4839https://www.debian.org/security/2021/dsa-4839
- lists.fedoraproject.orgFEDORA-2021-2cb63d912ahttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/
- lists.fedoraproject.orgFEDORA-2021-8840cbdccdhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/
- www.openwall.com[oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)http://www.openwall.com/lists/oss-security/2021/01/27/1
- www.openwall.com[oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)http://www.openwall.com/lists/oss-security/2021/01/27/2
- tools.cisco.com20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM
- www.kb.cert.orgVU#794544https://www.kb.cert.org/vuls/id/794544
- seclists.org20210211 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-002http://seclists.org/fulldisclosure/2021/Feb/42
- www.openwall.com[oss-security] 20210215 Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedithttp://www.openwall.com/lists/oss-security/2021/02/15/1
- www.oracle.comhttps://www.oracle.com//security-alerts/cpujul2021.html
- www.sudo.wshttps://www.sudo.ws/stable.html#1.9.5p2
- www.openwall.comhttps://www.openwall.com/lists/oss-security/2021/01/26/3
- packetstormsecurity.comhttp://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
- security.netapp.comhttps://security.netapp.com/advisory/ntap-20210128-0002/
- security.netapp.comhttps://security.netapp.com/advisory/ntap-20210128-0001/
- packetstormsecurity.comhttp://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html
- packetstormsecurity.comhttp://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html
- packetstormsecurity.comhttp://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html
- support.apple.comhttps://support.apple.com/kb/HT212177
- kc.mcafee.comhttps://kc.mcafee.com/corporate/index?page=content&id=SB10348
- www.beyondtrust.comhttps://www.beyondtrust.com/blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability
- www.synology.comhttps://www.synology.com/security/advisory/Synology_SA_21_02
- www.openwall.com[oss-security] 20210914 Re: Oracle Solaris membership in the distros listhttp://www.openwall.com/lists/oss-security/2021/09/14/2
- www.oracle.comhttps://www.oracle.com/security-alerts/cpuoct2021.html
- www.oracle.comhttps://www.oracle.com/security-alerts/cpuapr2022.html
- www.openwall.com[oss-security] 20240130 Re: CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()http://www.openwall.com/lists/oss-security/2024/01/30/8
- www.openwall.com[oss-security] 20240130 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()http://www.openwall.com/lists/oss-security/2024/01/30/6
- packetstormsecurity.comhttp://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- seclists.org20240204 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()http://seclists.org/fulldisclosure/2024/Feb/3
- www.vicarius.iohttps://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156
- www.cisa.govhttps://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156
07 Fixed in
Arch Linux
- sudo Fixed in 1.9.5.p2-1
Source: Arch Linux Security Tracker, the Arch Linux security team. Reformatted by exploit.cc.
Debian 12
- sudo Fixed in 1.9.5p1-1.1
Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.
Debian 13
- sudo Fixed in 1.9.5p1-1.1
Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.
Debian 14
- sudo Fixed in 1.9.5p1-1.1
Source: Debian Security Tracker, the Debian security team. Received through OSV.dev. Reformatted by exploit.cc.
Ubuntu 16.04 LTS
- sudo Fixed in 1.8.16-0ubuntu1.10
Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.
Ubuntu 18.04 LTS
- sudo Fixed in 1.8.21p2-3ubuntu1.4
Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.
Ubuntu 20.04 LTS
- sudo Fixed in 1.8.31-1ubuntu1.2
Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.
Ubuntu Pro 14.04 LTS
- sudo Fixed in 1.8.9p5-1ubuntu1.5+esm6Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro
Source: Ubuntu, Canonical Ltd. Licensed under CC BY-SA 4.0. Received through OSV.dev. Reformatted by exploit.cc.
A release or ecosystem missing from this list has no record here. It may be unaffected or not covered by the source. Source notices and licences.