CVE-2021-3156

CRITICALNVD 7.89.0▲
EchelonGraph scoreHIGH confidence

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.

Triggered by: CISA KEV (actively exploited)
Sources: cisa_kev, epss, ghsa, nvd
Exploited in the wild
9.0EG
EchelonGraph verdictPatch nowTreat as an emergency — this is being exploited.
  • Actively exploited in the wild (CISA-KEV)
CISA-KEV: ExploitedEPSS PROB: 100%CVSS: 7.8Exploit: cisa kev · ssvc active · Metasploit · epss top5pct · epss high · public exploitExposed services: Not assessed

A fix is available — apply it.

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.

CVSS v3
7.8
EG Score
9.0CRITICALhigh confidence
EG Risk
81
EG Risk 81/100CISA SSVC

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 computed
Severity90% × 45%
Exploitation100% × 40%
Automatability0% × 15%
CISA SSVC: Track at low, Attend at medium and Act at high mission impact.
Action: A fix is available. Apply it within your standard update timelines at low, sooner than that at medium and as soon as possible at high mission impact.
EPSS PROB
100%
EPSS %ILE
99th
KEV
⚠ Exploited

CISA SSVCTrack at low, Attend at medium and Act at high mission impact.

A fix is available. Apply it within your standard update timelines at low, sooner than that at medium and as soon as possible at high mission impact.

Exploitation active (CISA Vulnrichment) · Automatable no (CISA Vulnrichment) · Technical impact total (CISA Vulnrichment). Mission impact is CISA's Mission & Well-being decision point, and only you can judge it: high means the affected system is essential to your organisation's mission, or its compromise could cause irreversible harm to people. CISA's decision table

Published

January 26, 2021

Last Modified

November 10, 2025

Advisory Details (8)

Auto-updated Jun 4, 2026
🔬 Proof of concept available. Patch available.
generic

oss-security - Re: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)

http://www.openwall.com/lists/oss-security/2021/01/27/1
generic

oss-security - Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)

http://www.openwall.com/lists/oss-security/2021/01/26/3
generic🟡 PoC Available

Full Disclosure: CVE-2023-6246: Heap-based buffer overflow in the glibc's syslog()

http://seclists.org/fulldisclosure/2024/Feb/3
generic

Full Disclosure: Baron Samedit: Heap-based buffer overflow in Sudo (CVE-2021-3156)

http://seclists.org/fulldisclosure/2021/Jan/79
generic

Full 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/42

Vendor Advisories for CVE-2021-3156(1)

These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.

Patch Availability(14)

Vendor / EcosystemFix (by version range) / PatchReleasedSource
ubuntusudo-ldap (1.9.1-1ubuntu1.1) @ groovy2026-10-09ubuntu
ubuntusudo (1.8.9p5-1ubuntu1.5+esm6) @ trusty2026-10-09ubuntu
redhatredhat-virtualization-host-0:4.3.13-20210127.0.el7_92021-02-03redhat
redhatredhat-virtualization-host-0:4.4.4-20210201.0.el8_32021-02-03redhat
redhatsudo-0:1.8.23-10.el7_9.12021-01-27redhat
redhatsudo-0:1.8.23-3.el7_6.22021-01-27redhat
redhatsudo-0:1.8.6p7-23.el7_3.32021-01-26redhat
redhatsudo-0:1.8.6p7-17.el7_2.32021-01-26redhat
redhatsudo-0:1.8.23-4.el7_7.32021-01-26redhat
redhatsudo-0:1.8.29-5.el8_2.12021-01-26redhat
redhatsudo-0:1.8.19p2-12.el7_4.22021-01-26redhat
redhatsudo-0:1.8.25p1-8.el8_1.22021-01-26redhat
redhatsudo-0:1.8.6p3-29.el6_10.42021-01-26redhat
redhatsudo-0:1.8.29-6.el8_3.12021-01-26redhat

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)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.9.5p2-r0: fixed in 1.9.5p2-r0
—
Alpine:v3.11(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.8.31-r1: fixed in 1.8.31-r1
—
Alpine:v3.12(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.9.5p2-r0: fixed in 1.9.5p2-r0
—
Alpine:v3.13(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.9.5p2-r0: fixed in 1.9.5p2-r0
—
Alpine:v3.14(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.9.5p2-r0: fixed in 1.9.5p2-r0
—
Alpine:v3.15(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • 1.8.2 up to 1.9.5p2-r0: fixed in 1.9.5p2-r0
—
Debian:10(1)
PackageVulnerable rangeFix by version rangeDependents
sudo1.8.27-1, 1.8.27-1+deb10u1, 1.8.27-1+deb10u2
  • every version up to 1.8.27-1+deb10u3: fixed in 1.8.27-1+deb10u3
—
Debian:11(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • every version up to 1.9.5p1-1.1: fixed in 1.9.5p1-1.1
—
Debian:12(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • every version up to 1.9.5p1-1.1: fixed in 1.9.5p1-1.1
—
Debian:13(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • every version up to 1.9.5p1-1.1: fixed in 1.9.5p1-1.1
—
Debian:14(1)
PackageVulnerable rangeFix by version rangeDependents
sudo—
  • every version up to 1.9.5p1-1.1: fixed in 1.9.5p1-1.1
—
Debian:9(1)
PackageVulnerable rangeFix by version rangeDependents
sudo1.8.19p1-2.1, 1.8.19p1-2.1+deb9u1, 1.8.19p1-2.1+deb9u2
  • every version up to 1.8.19p1-2.1+deb9u3: fixed in 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)

Data Freshness Timeline

(refreshed 90× in last 7d / 384× 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,642 total refreshes for this CVE.

  1. 2026-10-09 23:37 UTCVendor advisory
  2. 2026-10-09 23:37 UTCGHSA enrichment
  3. 2026-10-09 19:37 UTCVendor advisory
  4. 2026-10-09 19:37 UTCGHSA enrichment
  5. 2026-10-09 15:35 UTCVendor advisory
  6. 2026-10-09 15:34 UTCGHSA enrichment
  7. 2026-10-09 11:34 UTCVendor advisory
  8. 2026-10-09 11:34 UTCGHSA enrichment
  9. 2026-10-09 07:33 UTCVendor advisory
  10. 2026-10-09 07:32 UTCGHSA enrichment
  11. 2026-10-09 03:30 UTCVendor advisory
  12. 2026-10-09 03:30 UTCGHSA enrichment
  13. 2026-10-08 23:29 UTCVendor advisory
  14. 2026-10-08 23:29 UTCGHSA enrichment
  15. 2026-10-08 19:29 UTCVendor advisory
  16. 2026-10-08 19:29 UTCGHSA enrichment
  17. 2026-10-08 15:28 UTCVendor advisory
  18. 2026-10-08 15:28 UTCGHSA enrichment
  19. 2026-10-08 11:27 UTCVendor advisory
  20. 2026-10-08 11:27 UTCGHSA enrichment
  21. 2026-10-08 07:26 UTCVendor advisory
  22. 2026-10-08 07:26 UTCGHSA enrichment
  23. 2026-10-08 03:25 UTCVendor advisory
  24. 2026-10-08 03:25 UTCGHSA enrichment
  25. 2026-10-07 23:25 UTCVendor advisory
Show 75 more
  1. 2026-10-07 23:25 UTCGHSA enrichment
  2. 2026-10-07 19:25 UTCVendor advisory
  3. 2026-10-07 19:25 UTCGHSA enrichment
  4. 2026-10-07 15:24 UTCVendor advisory
  5. 2026-10-07 15:24 UTCGHSA enrichment
  6. 2026-10-07 11:23 UTCVendor advisory
  7. 2026-10-07 11:23 UTCGHSA enrichment
  8. 2026-10-07 07:23 UTCVendor advisory
  9. 2026-10-07 07:23 UTCGHSA enrichment
  10. 2026-10-07 03:22 UTCVendor advisory
  11. 2026-10-07 03:22 UTCGHSA enrichment
  12. 2026-10-06 23:21 UTCVendor advisory
  13. 2026-10-06 23:21 UTCGHSA enrichment
  14. 2026-10-06 19:21 UTCVendor advisory
  15. 2026-10-06 19:21 UTCGHSA enrichment
  16. 2026-10-06 15:21 UTCVendor advisory
  17. 2026-10-06 15:20 UTCGHSA enrichment
  18. 2026-10-06 11:17 UTCVendor advisory
  19. 2026-10-06 11:17 UTCGHSA enrichment
  20. 2026-10-06 07:17 UTCVendor advisory
  21. 2026-10-06 07:17 UTCGHSA enrichment
  22. 2026-10-06 03:16 UTCVendor advisory
  23. 2026-10-06 03:16 UTCGHSA enrichment
  24. 2026-10-06 03:16 UTCVendor advisory
  25. 2026-10-06 03:16 UTCVendor advisory
  26. 2026-10-06 03:16 UTCGHSA enrichment
  27. 2026-10-06 03:16 UTCGHSA enrichment
  28. 2026-10-06 03:16 UTCVendor advisory
  29. 2026-10-06 03:16 UTCGHSA enrichment
  30. 2026-10-06 03:15 UTCVendor advisory
  31. 2026-10-06 03:15 UTCGHSA enrichment
  32. 2026-10-05 23:14 UTCVendor advisory
  33. 2026-10-05 23:13 UTCGHSA enrichment
  34. 2026-10-05 19:13 UTCVendor advisory
  35. 2026-10-05 19:12 UTCGHSA enrichment
  36. 2026-10-05 15:12 UTCVendor advisory
  37. 2026-10-05 15:12 UTCGHSA enrichment
  38. 2026-10-05 11:09 UTCVendor advisory
  39. 2026-10-05 11:08 UTCGHSA enrichment
  40. 2026-10-05 07:08 UTCVendor advisory
  41. 2026-10-05 07:08 UTCGHSA enrichment
  42. 2026-10-05 03:07 UTCVendor advisory
  43. 2026-10-05 03:07 UTCGHSA enrichment
  44. 2026-10-04 23:06 UTCVendor advisory
  45. 2026-10-04 23:06 UTCGHSA enrichment
  46. 2026-10-04 19:05 UTCVendor advisory
  47. 2026-10-04 19:05 UTCGHSA enrichment
  48. 2026-10-04 15:04 UTCVendor advisory
  49. 2026-10-04 15:04 UTCGHSA enrichment
  50. 2026-10-04 11:03 UTCVendor advisory
  51. 2026-10-04 11:03 UTCGHSA enrichment
  52. 2026-10-04 07:03 UTCVendor advisory
  53. 2026-10-04 07:03 UTCGHSA enrichment
  54. 2026-10-04 03:02 UTCVendor advisory
  55. 2026-10-04 03:02 UTCGHSA enrichment
  56. 2026-10-03 23:02 UTCVendor advisory
  57. 2026-10-03 23:02 UTCGHSA enrichment
  58. 2026-10-03 19:01 UTCVendor advisory
  59. 2026-10-03 19:01 UTCGHSA enrichment
  60. 2026-10-03 14:59 UTCVendor advisory
  61. 2026-10-03 14:59 UTCGHSA enrichment
  62. 2026-10-03 10:57 UTCVendor advisory
  63. 2026-10-03 10:57 UTCGHSA enrichment
  64. 2026-10-03 06:56 UTCVendor advisory
  65. 2026-10-03 06:56 UTCGHSA enrichment
  66. 2026-10-03 02:55 UTCVendor advisory
  67. 2026-10-03 02:55 UTCGHSA enrichment
  68. 2026-10-02 22:52 UTCVendor advisory
  69. 2026-10-02 22:52 UTCGHSA enrichment
  70. 2026-10-02 18:52 UTCVendor advisory
  71. 2026-10-02 18:52 UTCGHSA enrichment
  72. 2026-10-02 14:51 UTCVendor advisory
  73. 2026-10-02 14:51 UTCGHSA enrichment
  74. 2026-10-02 10:51 UTCVendor advisory
  75. 2026-10-02 10:50 UTCGHSA enrichment

Publicly available exploits

(10 references)

Working exploit code is in the public domain (1 Metasploit module) (9 GitHub PoCs). Defenders should treat patch urgency accordingly — public PoCs typically lead to mass-exploitation within 24-72 hours.

  • Metasploitexploit/linux/local/sudo_baron_samedit✓ verified
    First seen Jan 26, 2021

    Sudo Heap-Based Buffer Overflow

    Open source ↗
  • GitHub PoCMaalfer/Sudo-CVE-2021-3156
    First seen Jul 18, 2025

    Exploit para explotar la vulnerabilidad CVE-2025-32463

    Open source ↗
  • GitHub PoCPurpleOzone/PE_CVE-CVE-2021-3156
    First seen May 13, 2023

    Exploit for Ubuntu 20.04 using CVE-2021-3156 enhanced with post-exploitation scripts

    Open source ↗
  • GitHub PoC0x4ndy/clif
    First 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-centos7
    First seen Nov 3, 2022

    利用sudo提权,只针对cnetos7

    Open source ↗
  • GitHub PoCredhawkeye/sudo-exploit
    First seen Sep 25, 2021

    CVE-2021-3156 - sudo exploit for ubuntu 18.04 & 20.04

    Open source ↗
  • GitHub PoCLiveOverflow/pwnedit
    First seen Apr 29, 2021

    CVE-2021-3156 - Sudo Baron Samedit

    Open source ↗
  • GitHub PoCworawit/CVE-2021-3156
    First seen Mar 15, 2021

    Sudo Baron Samedit Exploit

    Open source ↗
  • GitHub PoCRvn0xsy/CVE-2021-3156-plus
    First seen Feb 9, 2021

    CVE-2021-3156非交互式执行命令

    Open source ↗
  • GitHub PoC0xdevil/CVE-2021-3156
    First seen Feb 8, 2021

    CVE-2021-3156: Sudo heap overflow exploit for Debian 10

    Open source ↗

Frequently asked(6)

What is CVE-2021-3156?
CVE-2021-3156 is a critical vulnerability published on January 26, 2021. 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.
When was CVE-2021-3156 disclosed?
CVE-2021-3156 was first published on January 26, 2021, with the most recent update on November 10, 2025. EchelonGraph re-ingests CVE updates from NVD on a 2-hour cycle, so this page reflects the latest published state.
Is CVE-2021-3156 actively exploited?
Yes. CISA added CVE-2021-3156 to the Known Exploited Vulnerabilities catalog on April 6, 2022, affecting Sudo Sudo. KEV listing indicates confirmed exploitation in the wild; this CVE warrants immediate attention. A fix is available. Apply it.
What is the CVSS score of CVE-2021-3156?
CVE-2021-3156 has a CVSS v3 base score of 7.8 (NVD). EchelonGraph synthesises NVD + CISA KEV + FIRST EPSS + GHSA into a combined EG score of 9.0 (CRITICAL).
Which products are affected by CVE-2021-3156?
CVE-2021-3156 affects Sudo Sudo. The affected packages EchelonGraph has on record, with version ranges, are listed in the Affected Packages section of this page.
How do I remediate CVE-2021-3156?
A fix for CVE-2021-3156 is available: update to the fixed version the vendor names in its advisory. The vendor advisories EchelonGraph has for CVE-2021-3156 are linked in the Vendor Advisories panel on this page.

Dependency Blast Radius

See which npm, PyPI, Go, and Maven packages are affected by CVE-2021-3156

Explore →

Is Your Infrastructure Affected by CVE-2021-3156?

EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.