Sudo Heap-Based Buffer Overflow Vulnerability
Exploited since 2022-04-06. No WAF vendor names it yet. 1 public exploit repo.
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.
Edge coverage
Claimed by vendorsAsk Vigil
AI · answers from this pageWorkers AI (Llama 3.3). Can be wrong: check the cited source.
Severity, decoded
CVSS 3.1Exploitable with local access, with low privileges and no user interaction, leading to full loss of confidentiality, integrity and availability.
How the score is built
- 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:HAttackers are exploiting this in the wild.
At least one step needs hands-on work, which slows mass attacks.
A successful attack gives full control over the affected software or all of its data.
Public exploits
4 found- MetasploitSudo Heap-Based Buffer Overflow2021-01-26 · exploit · rank Excellent · has check
- Exploit-DBSudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)2021-02-03 · local · multiple
- Exploit-DBSudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)2021-02-03 · local · multiple
Links are to third-party code: never run it outside an isolated lab.
Timeline
- 2021-01-26CVE publishedCVE List
- 2021-01-26Metasploit module publishedSudo Heap-Based Buffer Overflow
- 2021-02-03Exploit published on Exploit-DBSudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)
- 2022-04-06Added to CISA KEVConfirmed exploitation in the wild
- 2026-11-02First public exploit repositoryAmroYasserH/DFIR-CVE-2021-3156-Incident-Response: DFIR investigation of SSH brute force attack and privilege escalation via CVE-2021-3156.
- 2026-11-02
Vendor statements
QuotedCloudflareWAF Managed Rules
The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.
AWSAWS WAF Managed Rules
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)
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 rules
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 patches
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)
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)
This vendor publishes no machine-readable rule changelog we can check.
OWASP CRSCore Rule Set (open source, used inside many WAFs)
The CVE predates the oldest entry in this vendor's public feed, so a rule may exist that we cannot see.
Social
Exploit repos · unvetted, don't run
AmroYasserH/DFIR-CVE-2021-3156-Incident-Response: DFIR investigation of SSH brute force attack and privilege escalation via CVE-2021-3156.