CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability
Advisory generated from the CVE record, CISA, Exploit Observer and VEDAS: what it is, whether it is exploited, who is affected, and how to fix and detect it.
Generated by VEDAS. Scores as of 2026-11-08 00:03 UTC. Rebuilt every few hours from cve-scores, CISA KEV and vedas-signatures. How this works and its limits.
What it is
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.
Description quoted from the CVE record (assigned by mitre, published 2021-01-26).
Weakness: CWE-193 Off-by-one Error
How it can be exploited
Exploitable with local access with low attack complexity needing low privileges and no user interaction. Impact: confidentiality high, integrity high, availability high. CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CISA assessment (SSVC): CISA assesses exploitation as active. Automatable: no. Technical impact: total.
- On CISA KEV since
- 2022-04-06
- US federal deadline
- 2022-04-27
- Ransomware use
- Not known
Public exploit evidence (Exploit Observer)
Exploit Observer found 2 Exploit-DB entries, 1 Nuclei template, 103 code repositories and 11 research write-ups naming this CVE.
Code repositories that name a CVE are often scanners, copies or fakes, and some are malware. Read the code before running anything.
See all 133 references on Exploit Observer
Live scores
- EPSS
- 1.000
very likely to be attacked soon - VEDAS
- 0.984
strong exploit evidence - On CISA KEV
- Yes, since 2022-04-06
- Detection rule
- Out of scope (local)
Thin horizontal line: the “likely exploited” threshold (EPSS 0.10, VEDAS 0.5). Shaded “no data” areas are periods when cve-scores did not publish.
Who is affected
| Product | Affected | Not affected |
|---|---|---|
| Not stated | versions not stated in the record | Not stated |
Version ranges exactly as the CVE record states them. “Before X” means X is the first fixed version.
How to fix it
CISA required action: Apply updates per vendor instructions.
Vendor guidance:
- GLSA-202101-33 (vendor-advisory)
- DSA-4839 (vendor-advisory)
- FEDORA-2021-2cb63d912a (vendor-advisory)
- FEDORA-2021-8840cbdccd (vendor-advisory)
- 20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021 (vendor-advisory)
How to detect it
This bug needs local access to exploit. VEDAS signatures cover remotely exploitable bugs for now, so there is no network rule or remote check for it. Patch it and watch your endpoint telemetry for unusual local activity.
Advisories on this CVE
- ARTEX AI pentest operators exposed their own servers, revealing an agentic hacking campaign against South Korean banks (full advisory)
References
Vendor advisories and patches
- GLSA-202101-33 (vendor-advisory)
- DSA-4839 (vendor-advisory)
- FEDORA-2021-2cb63d912a (vendor-advisory)
- FEDORA-2021-8840cbdccd (vendor-advisory)
- 20210129 Sudo Privilege Escalation Vulnerability Affecting Cisco Products: January 2021 (vendor-advisory)
Technical analysis and advisories
- VU#794544 (third-party-advisory)
Government sources
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156 (government-resource)
Other references
- [debian-lts-announce] 20210126 [SECURITY] [DLA 2534-1] sudo security update (mailing-list)
- 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (mailing-list)
- [oss-security] 20210126 Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (mailing-list)
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (mailing-list)
- [oss-security] 20210127 Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156) (mailing-list)
- 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 (mailing-list)
- [oss-security] 20210215 Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedit (mailing-list)
- 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/
16 more
- 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 (mailing-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() (mailing-list)
- [oss-security] 20240130 CVE-2023-6246: Heap-based buffer overflow in the glibc’s syslog() (mailing-list)
- 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() (mailing-list)
- https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156
Other databases
Where this comes from
This advisory is generated automatically by VEDAS from: CVE.org record, CISA KEV, cve-scores (EPSS and VEDAS), Exploit Observer. Text in quotes is reproduced from the source; everything else is a fixed template filled with source fields. Nothing here is written by a language model. Check the vendor advisory before acting, and read how VEDAS and Exploit Observer work, and their limits.