7.8

CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability

CVSS: 7.8v3.1HighKEVAnalyzed
AliasesALPINE-CVE-2021-3156MGASA-2021-0056SUSE-SU-2021:0928-1
Published 26-01-2021Last modified 21-10-2025

Vulnerability summary

CVE-2021-3156 is a high (CVSS 7.8) Off-by-one Error vulnerability in Sudo. It is known to be exploited: CISA lists it, first on 06-04-2022. EPSS estimates a 99.96% chance of exploitation in the next 30 days, higher than 99.9% of scored vulnerabilities. 15 public exploits are recorded.

Overall risk
85/100
0100
Critical · default modelHow is this calculated?
CVSS score
7.8/10
010
High · v3.1 (CVE.org)
EPSS score
99.96%
0%100%
Critical · -0.01 pp in 30 days
KEVListedCISA
RansomwareNone recordedNo known use recorded
Public exploits15reference, exploit-database, metasploit

Advisory lineage

Upstream 0 · Downstream 10 · Related 8

Timeline

  1. 26-01-2021
    PublishedVulnerability first disclosed.
  2. 06-04-2022
    Added to CISA KEVSudo Heap-Based Buffer Overflow Vulnerability
  3. 27-04-2022
    CISA remediation dueApply updates per vendor instructions.
  4. 21-10-2025
    Last modifiedVulnerability information updated.

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.

CVSS metrics

7 scores · 6 sources · 2 versions

EPSS trend

Probability

99.96%

Chance of exploitation in the next 30 days

Percentile

100%

Versus all other CVEs

30-day change

-0.01 pp

From 99.97% on 18-09-2026

18-09-202618-10-2026
EPSS score
99.96%

Known exploited

Compare KEV catalogs
CISA KEVListed
Added
06-04-2022
Federal due date
27-04-2022

CISA required action

Apply updates per vendor instructions. nvd.nist.gov/vuln/detail/CVE-2021-3156

Public exploits

15 found
  • referenceUnverified

    Exploit Reference (seclists.org)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (openwall.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (openwall.com)

    Maturity: unknown

Show all 15 exploits
  • referenceUnverified

    Exploit Reference (openwall.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (packetstormsecurity.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (packetstormsecurity.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (packetstormsecurity.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (packetstormsecurity.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (openwall.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (packetstormsecurity.com)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (seclists.org)

    Maturity: unknown

  • referenceUnverified

    Exploit Reference (vicarius.io)

    Maturity: unknown

  • exploit-databaselocalmultipleUnverified

    Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)

    Maturity: poc

  • exploit-databaselocalmultipleUnverified

    Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)

    Maturity: poc

  • MetasploitMetasploitremoteVerified

    Sudo Heap-Based Buffer Overflow

    exploit/linux/local/sudo_baron_samedit

    Maturity: weaponized

Weaknesses

CWE · root cause

Affected systems

Suse34 products
  • sudo&distro=HPE Helion OpenStack 8< 1.8.20p2-3.23.1
  • sudo&distro=SUSE Enterprise Storage 6< 1.8.22-4.18.1
  • sudo&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS< 1.8.22-4.18.1
  • sudo&distro=SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS< 1.8.22-4.18.1
  • sudo&distro=SUSE Linux Enterprise High Performance Computing 15-ESPOS< 1.8.22-4.18.1
Netapp7 products
Oracle7 products
Redhat4 products
  • sudo< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2 | < 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
  • sudo-debuginfo< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2 | < 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
  • sudo-debugsource< 0:1.8.29-6.el8_3.1 | < 0:1.8.29-5.el8_2.1 | < 0:1.8.25p1-8.el8_1.2
  • sudo-devel< 0:1.8.23-10.el7_9.1 | < 0:1.8.23-4.el7_7.3 | < 0:1.8.23-3.el7_6.2 | < 0:1.8.19p2-12.el7_4.2 | < 0:1.8.6p7-23.el7_3.3 | < 0:1.8.6p7-17.el7_2.3 | < 0:1.8.6p3-29.el6_10.4
Synology4 products
Beyondtrust2 products
Debian2 products
  • sudo< 1.9.5p1-1.1 | < 1.8.27-1+deb10u3 | < 1.8.19p1-2.1+deb9u3
  • debian_linuxEOL9.0 | 10.0
Alpine1 product
  • sudo≥ 1.8.2, < 1.9.5p2-r0 | ≥ 1.8.2, < 1.8.31-r1
Fedoraproject1 product
Mageia1 product
  • sudo< 1.9.5p2-1.mga7
Mcafee1 product
Opensuse1 product
  • sudo&distro=openSUSE Leap 15.2< 1.8.22-lp152.8.9.1
Sudo_project1 product
  • sudo≥ 1.8.2, < 1.8.32 | ≥ 1.9.0, < 1.9.5 | 1.9.5 | 1.9.5:patch1
Ubuntu1 product
  • sudo< 1.8.9p5-1ubuntu1.5+esm6 | < 1.8.16-0ubuntu1.10 | < 1.8.21p2-3ubuntu1.4 | < 1.8.31-1ubuntu1.2

14 vendors · 67 products

References

82 links
Show all 82 references