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.
CVE-2021-3156
Score elevated to 9.0 because this CVE is listed on the CISA Known Exploited Vulnerabilities catalog (added 2022-04-06), indicating real-world exploitation has been confirmed by US federal agencies. NVD baseline CVSS 7.8 retained for reference. Confidence: HIGH.
- Actively exploited in the wild (CISA-KEV)
A fix is available — apply it.
- CVSS v3
- 7.8
- EG Score
- 9.0(high)
- EG Risk
- 81(Attend)EG Risk 81/100SSVC: Attend
EG Risk is EchelonGraph's 0–100 priority score: it fuses intrinsic severity with real-world exploitation and automatability so you can rank equal-severity CVEs and fix the most dangerous first. Higher = act sooner. Distinct from the 0–10 EG Score (severity).
How it’s computedSeverity90% × 45%Exploitation100% × 40%Automatability0% × 15%Action: Remediate soon — notable exploitation risk. - EPSS PROB
- 100%
- EPSS %ILE
- 100%
- KEV
- ⚠ Exploited
Published
January 26, 2021
Last Modified
November 10, 2025
Advisory Details (8)
Auto-updated Jun 4, 2026oss-security - Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
http://www.openwall.com/lists/oss-security/2021/01/27/1oss-security - Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
http://www.openwall.com/lists/oss-security/2021/01/26/3Full Disclosure: CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()
http://seclists.org/fulldisclosure/2024/Feb/3Full Disclosure: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)
http://seclists.org/fulldisclosure/2021/Jan/79Full Disclosure: 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
http://seclists.org/fulldisclosure/2021/Feb/42Packet Storm
http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.htmlPatch Availability(14)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| ubuntu | sudo (1.8.9p5-1ubuntu1.5+esm6) @ trusty | 2026-08-25 | ubuntu |
| ubuntu | sudo-ldap (1.8.16-0ubuntu1.10) @ xenial | 2026-08-25 | ubuntu |
| redhat | redhat-virtualization-host-0:4.4.4-20210201.0.el8_3 | 2021-02-03 | redhat |
| redhat | redhat-virtualization-host-0:4.3.13-20210127.0.el7_9 | 2021-02-03 | redhat |
| redhat | sudo-0:1.8.23-10.el7_9.1 | 2021-01-27 | redhat |
| redhat | sudo-0:1.8.23-3.el7_6.2 | 2021-01-27 | redhat |
| redhat | sudo-0:1.8.25p1-8.el8_1.2 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.6p3-29.el6_10.4 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.23-4.el7_7.3 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.29-5.el8_2.1 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.19p2-12.el7_4.2 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.29-6.el8_3.1 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.6p7-17.el7_2.3 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.6p7-23.el7_3.3 | 2021-01-26 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(12 across 12 ecosystems)
Alpine:v3.10(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p2-r0 | — |
Alpine:v3.11(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.8.31-r1 | — |
Alpine:v3.12(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p2-r0 | — |
Alpine:v3.13(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p2-r0 | — |
Alpine:v3.14(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p2-r0 | — |
Alpine:v3.15(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p2-r0 | — |
Debian:10(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | 1.8.27-1, 1.8.27-1+deb10u1, 1.8.27-1+deb10u2 | 1.8.27-1+deb10u3 | — |
Debian:11(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p1-1.1 | — |
Debian:12(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p1-1.1 | — |
Debian:13(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p1-1.1 | — |
Debian:14(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | — | 1.9.5p1-1.1 | — |
Debian:9(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| sudo | 1.8.19p1-2.1, 1.8.19p1-2.1+deb9u1, 1.8.19p1-2.1+deb9u2 | 1.8.19p1-2.1+deb9u3 | — |
Weakness Classification(2)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
All Vendor Advisories
(14)
Every vendor that published an advisory referencing this CVE — pulled from our cve_vendor_advisories aggregation. Click any row for the vendor's original advisory page.
- Red HatRHSA-2021:0218IMPORTANT2021-01-26
RHSA-2021:0218 — Important
- Red HatRHSA-2021:0219IMPORTANT2021-01-26
RHSA-2021:0219 — Important
- Red HatRHSA-2021:0220IMPORTANT2021-01-26
RHSA-2021:0220 — Important
- Red HatRHSA-2021:0221IMPORTANT2021-01-26
RHSA-2021:0221 — Important
- Red HatRHSA-2021:0222IMPORTANT2021-01-26
RHSA-2021:0222 — Important
- Red HatRHSA-2021:0223IMPORTANT2021-01-26
RHSA-2021:0223 — Important
- Red HatRHSA-2021:0224IMPORTANT2021-01-26
RHSA-2021:0224 — Important
- Red HatRHSA-2021:0225IMPORTANT2021-01-26
RHSA-2021:0225 — Important
- Red HatRHSA-2021:0226IMPORTANT2021-01-26
RHSA-2021:0226 — Important
- Red HatRHSA-2021:0227IMPORTANT2021-01-26
RHSA-2021:0227 — Important
- Red HatRHSA-2021:0395IMPORTANT2021-01-26
RHSA-2021:0395 — Important
- Red HatRHSA-2021:0401IMPORTANT2021-01-26
RHSA-2021:0401 — Important
- UbuntuUSN-4705-1HIGH
Sudo vulnerabilities
- UbuntuUSN-4705-2HIGH
Sudo vulnerability
Data Freshness Timeline
(refreshed 91× in last 7d / 383× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
Showing the most recent 100 of 1,071 total refreshes for this CVE.
- 2026-08-25 21:33 UTCVendor advisory
- 2026-08-25 21:33 UTCGHSA enrichment
- 2026-08-25 17:32 UTCVendor advisory
- 2026-08-25 17:32 UTCGHSA enrichment
- 2026-08-25 13:32 UTCVendor advisory
- 2026-08-25 13:32 UTCGHSA enrichment
- 2026-08-25 09:31 UTCVendor advisory
- 2026-08-25 09:31 UTCGHSA enrichment
- 2026-08-25 05:30 UTCVendor advisory
- 2026-08-25 05:30 UTCGHSA enrichment
- 2026-08-25 01:30 UTCVendor advisory
- 2026-08-25 01:30 UTCGHSA enrichment
- 2026-08-24 21:29 UTCVendor advisory
- 2026-08-24 21:29 UTCGHSA enrichment
- 2026-08-24 18:52 UTCCISA KEV update
- 2026-08-24 17:28 UTCEG score recompute
- 2026-08-24 17:28 UTCVendor advisory
- 2026-08-24 17:28 UTCGHSA enrichment
- 2026-08-24 14:13 UTCEPSS rescore
- 2026-08-24 13:28 UTCVendor advisory
- 2026-08-24 13:28 UTCGHSA enrichment
- 2026-08-24 09:28 UTCEG score recompute
- 2026-08-24 09:28 UTCVendor advisory
- 2026-08-24 09:28 UTCGHSA enrichment
- 2026-08-24 05:27 UTCVendor advisory
Show 75 moreShow fewer
- 2026-08-24 05:27 UTCGHSA enrichment
- 2026-08-24 01:27 UTCVendor advisory
- 2026-08-24 01:27 UTCGHSA enrichment
- 2026-08-23 21:26 UTCVendor advisory
- 2026-08-23 21:26 UTCGHSA enrichment
- 2026-08-23 17:26 UTCVendor advisory
- 2026-08-23 17:26 UTCGHSA enrichment
- 2026-08-23 13:25 UTCVendor advisory
- 2026-08-23 13:25 UTCGHSA enrichment
- 2026-08-23 09:25 UTCVendor advisory
- 2026-08-23 09:25 UTCGHSA enrichment
- 2026-08-23 05:24 UTCVendor advisory
- 2026-08-23 05:24 UTCGHSA enrichment
- 2026-08-23 01:24 UTCVendor advisory
- 2026-08-23 01:23 UTCGHSA enrichment
- 2026-08-22 21:23 UTCVendor advisory
- 2026-08-22 21:23 UTCGHSA enrichment
- 2026-08-22 17:22 UTCVendor advisory
- 2026-08-22 17:22 UTCGHSA enrichment
- 2026-08-22 13:21 UTCVendor advisory
- 2026-08-22 13:21 UTCGHSA enrichment
- 2026-08-22 09:21 UTCVendor advisory
- 2026-08-22 09:21 UTCGHSA enrichment
- 2026-08-22 05:20 UTCVendor advisory
- 2026-08-22 05:20 UTCGHSA enrichment
- 2026-08-22 01:19 UTCVendor advisory
- 2026-08-22 01:19 UTCGHSA enrichment
- 2026-08-21 21:19 UTCVendor advisory
- 2026-08-21 21:19 UTCGHSA enrichment
- 2026-08-21 17:18 UTCVendor advisory
- 2026-08-21 17:18 UTCGHSA enrichment
- 2026-08-21 16:49 UTCCISA KEV update
- 2026-08-21 13:18 UTCVendor advisory
- 2026-08-21 13:18 UTCGHSA enrichment
- 2026-08-21 09:17 UTCVendor advisory
- 2026-08-21 09:17 UTCGHSA enrichment
- 2026-08-21 05:16 UTCVendor advisory
- 2026-08-21 05:16 UTCGHSA enrichment
- 2026-08-21 01:15 UTCVendor advisory
- 2026-08-21 01:15 UTCGHSA enrichment
- 2026-08-20 21:15 UTCVendor advisory
- 2026-08-20 21:15 UTCGHSA enrichment
- 2026-08-20 17:15 UTCVendor advisory
- 2026-08-20 17:15 UTCGHSA enrichment
- 2026-08-20 17:06 UTCCISA KEV update
- 2026-08-20 13:14 UTCVendor advisory
- 2026-08-20 13:14 UTCGHSA enrichment
- 2026-08-20 09:12 UTCVendor advisory
- 2026-08-20 09:11 UTCGHSA enrichment
- 2026-08-20 05:10 UTCVendor advisory
- 2026-08-20 05:10 UTCGHSA enrichment
- 2026-08-20 01:09 UTCVendor advisory
- 2026-08-20 01:09 UTCGHSA enrichment
- 2026-08-19 21:08 UTCVendor advisory
- 2026-08-19 21:08 UTCGHSA enrichment
- 2026-08-19 17:33 UTCCISA KEV update
- 2026-08-19 17:07 UTCVendor advisory
- 2026-08-19 17:07 UTCGHSA enrichment
- 2026-08-19 13:06 UTCVendor advisory
- 2026-08-19 13:06 UTCGHSA enrichment
- 2026-08-19 09:06 UTCVendor advisory
- 2026-08-19 09:06 UTCGHSA enrichment
- 2026-08-19 05:05 UTCVendor advisory
- 2026-08-19 05:05 UTCGHSA enrichment
- 2026-08-19 01:03 UTCVendor advisory
- 2026-08-19 01:03 UTCGHSA enrichment
- 2026-08-18 21:02 UTCVendor advisory
- 2026-08-18 21:02 UTCGHSA enrichment
- 2026-08-18 17:01 UTCVendor advisory
- 2026-08-18 17:01 UTCGHSA enrichment
- 2026-08-18 16:58 UTCCISA KEV update
- 2026-08-18 13:00 UTCVendor advisory
- 2026-08-18 13:00 UTCGHSA enrichment
- 2026-08-18 08:59 UTCVendor advisory
- 2026-08-18 08:59 UTCGHSA enrichment
Publicly available exploits
(10 references)Working exploit code is in the public domain (9 GitHub PoCs) (1 Exploit-DB entry). Defenders should treat patch urgency accordingly — public PoCs typically lead to mass-exploitation within 24-72 hours.
- GitHub PoCMaalfer/Sudo-CVE-2021-3156First seen Jul 18, 2025
Exploit para explotar la vulnerabilidad CVE-2025-32463
Open source ↗ - GitHub PoCPurpleOzone/PE_CVE-CVE-2021-3156First seen May 13, 2023
Exploit for Ubuntu 20.04 using CVE-2021-3156 enhanced with post-exploitation scripts
Open source ↗ - GitHub PoC0x4ndy/clifFirst seen Nov 28, 2022
clif is a command-line interface (CLI) application fuzzer, pretty much what wfuzz or ffuf are for web. It was inspired by sudo vulnerability CVE-2021-3156 and the fact that for some reasons, Google's afl-fuzz doesn't allow for unlimited argument or option specification.
Open source ↗ - GitHub PoCPhuketIsland/CVE-2021-3156-centos7First seen Nov 3, 2022
利用sudo提权,只针对cnetos7
Open source ↗ - GitHub PoCredhawkeye/sudo-exploitFirst seen Sep 25, 2021
CVE-2021-3156 - sudo exploit for ubuntu 18.04 & 20.04
Open source ↗ - GitHub PoCLiveOverflow/pwneditFirst seen Apr 29, 2021
CVE-2021-3156 - Sudo Baron Samedit
Open source ↗ - GitHub PoCworawit/CVE-2021-3156First seen Mar 15, 2021
Sudo Baron Samedit Exploit
Open source ↗ - GitHub PoCRvn0xsy/CVE-2021-3156-plusFirst seen Feb 9, 2021
CVE-2021-3156非交互式执行命令
Open source ↗ - GitHub PoC0xdevil/CVE-2021-3156First seen Feb 8, 2021
CVE-2021-3156: Sudo heap overflow exploit for Debian 10
Open source ↗ - Exploit-DBEDB-49521First seen Feb 3, 2021
Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)
Open source ↗
Related CVEs(same vendor + same CWE)
Same vendor
10 shownredhat
- CVE-2001-0825EG 10.0HIGH
- CVE-2001-1009EG 10.0EPSS p93HIGH
- CVE-2001-0554EG 10.0EPSS p98HIGH
- CVE-2001-1162EG 10.0EPSS p96HIGH
- CVE-2001-0414EG 10.0EPSS p100HIGH
- CVE-2001-0191EG 10.0EPSS p92HIGH
- CVE-2001-0301EG 10.0EPSS p91HIGH
- CVE-2001-0197EG 10.0EPSS p96HIGH
- CVE-2001-0233EG 10.0EPSS p96HIGH
- CVE-2001-0010EG 10.0EPSS p98HIGH
Same CWE
10 shownCWE-787 · CWE-193
- CVE-2004-0978EG 10.0EPSS p98HIGH
- CVE-2004-1287EG 10.0EPSS p97HIGH
- CVE-2004-0574EG 10.0EPSS p99HIGH
- CVE-2002-2227EG 10.0HIGH
- CVE-2006-10003EG 9.8CRITICAL
- CVE-2007-0158EG 9.8CRITICAL
- CVE-2007-0899EG 9.8CRITICAL
- CVE-2004-0005EG 9.8EPSS p96CRITICAL
- CVE-2003-0466EG 9.8EPSS p100CRITICAL
- CVE-2003-0252EG 9.8EPSS p97CRITICAL
Frequently asked(6)
What is CVE-2021-3156?
When was CVE-2021-3156 disclosed?
Is CVE-2021-3156 actively exploited?
What is the CVSS score of CVE-2021-3156?
Which products are affected by CVE-2021-3156?
How do I remediate CVE-2021-3156?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2021-3156
Is Your Infrastructure Affected by CVE-2021-3156?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.