CVE-2021-3156
Off-by-one Error
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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.
Official description from the CVE record, published by mitre. Copyright © 1999-2026 The MITRE Corporation. See /security/cve/legal for the CVE license. View the record on cve.org
Key data
CVSS 3.1 High 7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector: Local
The attacker needs local access to the system, or to trick a user into running something.
Attack complexity: Low
No special conditions are needed. The attack can be repeated at will.
Privileges required: Low
A basic user account is needed.
User interaction: None
No action from any user is needed.
Scope: Unchanged
The impact stays within the vulnerable component.
Confidentiality impact: High
Serious or total effect on the secrecy of data.
Integrity impact: High
Serious or total effect on the trustworthiness of data.
Availability impact: High
Serious or total effect on availability.
| Metric | Value | What it means |
|---|---|---|
| Attack vector | Local | The attacker needs local access to the system, or to trick a user into running something. |
| Attack complexity | Low | No special conditions are needed. The attack can be repeated at will. |
| Privileges required | Low | A basic user account is needed. |
| User interaction | None | No action from any user is needed. |
| Scope | Unchanged | The impact stays within the vulnerable component. |
| Confidentiality impact | High | Serious or total effect on the secrecy of data. |
| Integrity impact | High | Serious or total effect on the trustworthiness of data. |
| Availability impact | High | Serious or total effect on availability. |
CVSS is owned and managed by FIRST.Org, Inc. (FIRST) and is used by permission. Each CVSS score on this site is shown together with its vector string, as published in the CVE record by the source named next to it. Learn more at first.org/cvss.
EPSS
- Score
- 0.99962 (99.96% probability)
- Percentile
- 99.97%
- Scores of
- Nov 10, 2026
- Model
- v2026.06.15
CISA Known Exploited Vulnerabilities
- Name in the catalog
- Sudo Heap-Based Buffer Overflow Vulnerability
- Added to the catalog
- Apr 6, 2022
- Federal due date
- Apr 27, 2022
CISA assessment as of Feb 3, 2025
- Exploitation
- Recorded by CISA as active
- Automatable
- no
- Technical impact
- total
Weakness (CWE)
- CWE-193Off-by-one Error
References
- [debian-lts-announce] 20210126 [SECURITY] [DLA 2534-1] sudo security update (lists.debian.org)mailing-list
- 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (seclists.org)mailing-list
- [oss-security] 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (openwall.com)mailing-list
- GLSA-202101-33 (security.gentoo.org)vendor-advisory
- DSA-4839 (debian.org)vendor-advisory
- FEDORA-2021-2cb63d912a (lists.fedoraproject.org)vendor-advisory
- FEDORA-2021-8840cbdccd (lists.fedoraproject.org)vendor-advisory
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (openwall.com)mailing-list
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (openwall.com)mailing-list
- 20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021 (tools.cisco.com)vendor-advisory
- VU#794544 (kb.cert.org)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 (seclists.org)mailing-list
- [oss-security] 20210215 Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedit (openwall.com)mailing-list
- oracle.com//security-alerts/cpujul2021.html
- sudo.ws/stable.html
- openwall.com/lists/oss-security/2021/01/26/3
- packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer…
- security.netapp.com/advisory/ntap-20210128-0002
- security.netapp.com/advisory/ntap-20210128-0001
- packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-P…
- packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Ov…
- packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-…
- support.apple.com/kb/HT212177
- kc.mcafee.com/corporate/index?page=content&id=SB10348
- beyondtrust.com/blog/entry/security-advisory-privilege-mana…
- synology.com/security/advisory/Synology_SA_21_02
- [oss-security] 20210914 Re: Oracle Solaris membership in the distros list (openwall.com)mailing-list
- oracle.com/security-alerts/cpuoct2021.html
- oracle.com/security-alerts/cpuapr2022.html
- [oss-security] 20240130 Re: CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() (openwall.com)mailing-list
- [oss-security] 20240130 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() (openwall.com)mailing-list
- packetstormsecurity.com/files/176932/glibc-syslog-Heap-Base…
- 20240204 CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog() (seclists.org)mailing-list
- vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156
Timeline
- ID reserved
- Record published
- Added to CISA KEV
- Record last updated
Look up another CVE
About CubePath
Data from the CVE Program (MITRE), CISA KEV and FIRST EPSS. CVSS is owned by FIRST and used by permission. Not affiliated with or endorsed by MITRE, CISA or FIRST. Data as of Nov 10, 2026, 19:51 UTC. Sources and licenses