Vigilbase CVEConnect your agent

Sudo Heap-Based Buffer Overflow Vulnerability

Exploited · KEV 2022-04-06Metasploit moduleCVE-2021-3156CWE-122CWE-193

Exploited since 2022-04-06. No WAF vendor names it yet. 1 public exploit repo.

Edge rules
0/8
Our test
No exploit yet
CVSS
7.8
EPSS
100.0% Top 0.1%
Posts, 14d
12026-10-20: 0 posts2026-10-21: 0 posts2026-10-22: 0 posts2026-10-23: 0 posts2026-10-24: 0 posts2026-10-25: 0 posts2026-10-26: 0 posts2026-10-27: 0 posts2026-10-28: 0 posts2026-10-29: 0 posts2026-10-30: 0 posts2026-10-31: 0 posts2026-11-01: 0 posts2026-11-02: 1 posts
Published
2021-01-26

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.

Ask Vigil

AI · answers from this page
Ask about CVE-2021-3156: who's covered, what to patch first, how vendors compare. I cite sources and won't help with attacks.

Workers AI (Llama 3.3). Can be wrong: check the cited source.

Severity, decoded

CVSS 3.1
High · 7.8 / 10

Exploitable with local access, with low privileges and no user interaction, leading to full loss of confidentiality, integrity and availability.

Needs local accessAny user loginNo user actionWorks reliablyFull compromise
How the score is built8 metrics
  • Attack vectorAn attacker needs local access, or must trick a user into opening something on the machine.
    Local
  • Attack complexityNo special conditions are needed; the attack works reliably.
    Low
  • Privileges requiredThe attacker needs an ordinary user account.
    Low
  • User interactionNo one has to click or open anything; the attack works on its own.
    None
  • ScopeThe damage stays within the vulnerable component.
    Unchanged
  • Confidentiality impactAn attacker can read all data the affected component holds, or the most sensitive parts of it.
    High
  • Integrity impactAn attacker can change any data or files the affected component protects.
    High
  • Availability impactAn attacker can take the component down completely or keep it from serving anyone.
    High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CISA's assessmentSSVC, from the CVE record
ExploitationActive

Attackers are exploiting this in the wild.

AutomatableNo

At least one step needs hands-on work, which slows mass attacks.

Technical impactTotal

A successful attack gives full control over the affected software or all of its data.

Public exploits

4 found
1 Metasploit2 Exploit-DB0 Scanner template1 GitHub PoCs

Links are to third-party code: never run it outside an isolated lab.

Timeline

  1. 2021-01-26
    CVE published
    CVE List
  2. 2021-01-26
    Metasploit module published
    Sudo Heap-Based Buffer Overflow
  3. 2021-02-03
    Exploit published on Exploit-DB
    Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)
  4. 2022-04-06
    Added to CISA KEV
    Confirmed exploitation in the wild
  5. 2026-11-02
    First public exploit repository
    AmroYasserH/DFIR-CVE-2021-3156-Incident-Response: DFIR investigation of SSH brute force attack and privilege escalation via CVE-2021-3156.
  6. 2026-11-02

Social

2026-10-20: 0 posts2026-10-21: 0 posts2026-10-22: 0 posts2026-10-23: 0 posts2026-10-24: 0 posts2026-10-25: 0 posts2026-10-26: 0 posts2026-10-27: 0 posts2026-10-28: 0 posts2026-10-29: 0 posts2026-10-30: 0 posts2026-10-31: 0 posts2026-11-01: 0 posts2026-11-02: 1 posts

Exploit repos · unvetted, don't run

  • AmroYasserH·

    AmroYasserH/DFIR-CVE-2021-3156-Incident-Response: DFIR investigation of SSH brute force attack and privilege escalation via CVE-2021-3156.

Vendor statements

Quoted
CloudflareWAF Managed RulesBefore feed history

The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.

AWSAWS WAF Managed RulesNo public claim

We found no public statement from this vendor naming this CVE. That is not proof of no protection: generic rules may still catch it. AWS often describes a vulnerability without naming its CVE (for example "Log4j"). We count only entries that name the CVE, so AWS coverage is understated.

Microsoft AzureFront Door and Application Gateway WAF (DRS)No public claim

We found no public statement from this vendor naming this CVE. That is not proof of no protection: generic rules may still catch it. The rule tables name CVEs but carry no dates, so Azure is left out of every time-to-rule figure.

Google CloudCloud Armor preconfigured WAF rulesBefore feed history

The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.

FastlyNext-Gen WAF virtual patchesBefore feed history

The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.

F5Attack signatures (Distributed Cloud WAF)Before feed history

The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.

AkamaiApp & API Protector (Adaptive Security Engine)No public source

This vendor publishes no machine-readable rule changelog we can check.

OWASP CRSCore Rule Set (open source, used inside many WAFs)Before feed history

The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.