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(medium)
- EPSS
- 99.9%
- 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-ldap (1.8.16-0ubuntu1.10) @ xenial | 2026-07-11 | ubuntu |
| ubuntu | sudo (1.8.9p5-1ubuntu1.5+esm6) @ trusty | 2026-07-11 | 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.19p2-12.el7_4.2 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.6p7-17.el7_2.3 | 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-6.el8_3.1 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.29-5.el8_2.1 | 2021-01-26 | redhat |
| redhat | sudo-0:1.8.25p1-8.el8_1.2 | 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.
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 129× in last 7d / 552× 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 772 total refreshes for this CVE.
- 2026-07-11 20:02 UTCEG score recompute
- 2026-07-11 20:02 UTCVendor advisory
- 2026-07-11 20:02 UTCGHSA enrichment
- 2026-07-11 16:01 UTCEG score recompute
- 2026-07-11 16:01 UTCVendor advisory
- 2026-07-11 16:01 UTCGHSA enrichment
- 2026-07-11 12:00 UTCEG score recompute
- 2026-07-11 12:00 UTCVendor advisory
- 2026-07-11 12:00 UTCGHSA enrichment
- 2026-07-11 07:59 UTCEG score recompute
- 2026-07-11 07:59 UTCVendor advisory
- 2026-07-11 07:59 UTCGHSA enrichment
- 2026-07-11 03:58 UTCEG score recompute
- 2026-07-11 03:58 UTCVendor advisory
- 2026-07-11 03:58 UTCGHSA enrichment
- 2026-07-10 23:57 UTCEG score recompute
- 2026-07-10 23:57 UTCVendor advisory
- 2026-07-10 23:57 UTCGHSA enrichment
- 2026-07-10 19:57 UTCEG score recompute
- 2026-07-10 19:57 UTCVendor advisory
- 2026-07-10 19:56 UTCGHSA enrichment
- 2026-07-10 17:52 UTCCISA KEV update
- 2026-07-10 15:55 UTCEG score recompute
- 2026-07-10 15:55 UTCVendor advisory
- 2026-07-10 15:55 UTCGHSA enrichment
Show 75 moreShow fewer
- 2026-07-10 11:54 UTCEG score recompute
- 2026-07-10 11:54 UTCVendor advisory
- 2026-07-10 11:54 UTCGHSA enrichment
- 2026-07-10 07:53 UTCEG score recompute
- 2026-07-10 07:53 UTCVendor advisory
- 2026-07-10 07:53 UTCGHSA enrichment
- 2026-07-10 03:53 UTCEG score recompute
- 2026-07-10 03:53 UTCVendor advisory
- 2026-07-10 03:53 UTCGHSA enrichment
- 2026-07-09 23:52 UTCEG score recompute
- 2026-07-09 23:52 UTCVendor advisory
- 2026-07-09 23:52 UTCGHSA enrichment
- 2026-07-09 19:52 UTCEG score recompute
- 2026-07-09 19:52 UTCVendor advisory
- 2026-07-09 19:51 UTCGHSA enrichment
- 2026-07-09 15:51 UTCEG score recompute
- 2026-07-09 15:51 UTCVendor advisory
- 2026-07-09 15:50 UTCGHSA enrichment
- 2026-07-09 11:47 UTCEG score recompute
- 2026-07-09 11:47 UTCVendor advisory
- 2026-07-09 11:47 UTCGHSA enrichment
- 2026-07-09 07:47 UTCEG score recompute
- 2026-07-09 07:47 UTCVendor advisory
- 2026-07-09 07:47 UTCGHSA enrichment
- 2026-07-09 03:44 UTCEG score recompute
- 2026-07-09 03:44 UTCVendor advisory
- 2026-07-09 03:44 UTCGHSA enrichment
- 2026-07-08 23:43 UTCEG score recompute
- 2026-07-08 23:43 UTCVendor advisory
- 2026-07-08 23:43 UTCGHSA enrichment
- 2026-07-08 19:42 UTCEG score recompute
- 2026-07-08 19:42 UTCVendor advisory
- 2026-07-08 19:42 UTCGHSA enrichment
- 2026-07-08 15:41 UTCEG score recompute
- 2026-07-08 15:41 UTCVendor advisory
- 2026-07-08 15:41 UTCGHSA enrichment
- 2026-07-08 11:40 UTCEG score recompute
- 2026-07-08 11:40 UTCVendor advisory
- 2026-07-08 11:40 UTCGHSA enrichment
- 2026-07-08 07:38 UTCEG score recompute
- 2026-07-08 07:38 UTCVendor advisory
- 2026-07-08 07:38 UTCGHSA enrichment
- 2026-07-08 03:37 UTCEG score recompute
- 2026-07-08 03:37 UTCVendor advisory
- 2026-07-08 03:37 UTCGHSA enrichment
- 2026-07-07 23:37 UTCEG score recompute
- 2026-07-07 23:37 UTCVendor advisory
- 2026-07-07 23:36 UTCGHSA enrichment
- 2026-07-07 19:36 UTCEG score recompute
- 2026-07-07 19:36 UTCVendor advisory
- 2026-07-07 19:36 UTCGHSA enrichment
- 2026-07-07 19:01 UTCCISA KEV update
- 2026-07-07 17:16 UTCCISA KEV update
- 2026-07-07 15:35 UTCEG score recompute
- 2026-07-07 15:35 UTCVendor advisory
- 2026-07-07 15:35 UTCGHSA enrichment
- 2026-07-07 11:32 UTCEG score recompute
- 2026-07-07 11:32 UTCVendor advisory
- 2026-07-07 11:32 UTCGHSA enrichment
- 2026-07-07 07:32 UTCEG score recompute
- 2026-07-07 07:32 UTCVendor advisory
- 2026-07-07 07:32 UTCGHSA enrichment
- 2026-07-07 03:30 UTCEG score recompute
- 2026-07-07 03:30 UTCVendor advisory
- 2026-07-07 03:30 UTCGHSA enrichment
- 2026-07-06 23:30 UTCEG score recompute
- 2026-07-06 23:30 UTCVendor advisory
- 2026-07-06 23:30 UTCGHSA enrichment
- 2026-07-06 19:29 UTCEG score recompute
- 2026-07-06 19:29 UTCVendor advisory
- 2026-07-06 19:29 UTCGHSA enrichment
- 2026-07-06 15:28 UTCEG score recompute
- 2026-07-06 15:28 UTCVendor advisory
- 2026-07-06 15:28 UTCGHSA enrichment
- 2026-07-06 11:27 UTCEG score recompute
Publicly available exploits
(10 references)Working exploit code is in the public domain (8 GitHub PoCs) (2 Exploit-DB entries). Defenders should treat patch urgency accordingly — public PoCs typically lead to mass-exploitation within 24-72 hours.
- 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 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 ↗ - Exploit-DBEDB-49522First seen Feb 3, 2021
Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)
Open source ↗ - GitHub PoCCptGibbon/CVE-2021-3156First seen Feb 3, 2021
Root shell PoC for CVE-2021-3156
Open source ↗ - Open source ↗GitHub PoCblasty/CVE-2021-3156First seen Jan 30, 2021
- GitHub PoCstong/CVE-2021-3156First seen Jan 30, 2021
PoC for CVE-2021-3156 (sudo heap overflow)
Open source ↗
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
Explore the affected products and dependency analysis for 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.