CVE-2021-3156
CVE-2021-3156 is a security flaw in Sudo. Someone who already has a foothold can use Sudo to take full control of the machine. The US Cybersecurity and Infrastructure Security Agency (CISA) added it to its catalog of flaws known to be used in attacks on 6 Apr 2022.[1]
Sudo is business software or equipment. Most families won’t have it, but attackers break into it to get inside companies, and from there to what those companies hold about their customers, patients and staff. Sudo has published a fix or advice.
Description
CISA calls it a heap-based buffer overflow in Sudo Sudo. In its words: “Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.”[1]
The CVE record adds: “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.”[2]
The underlying weakness is heap buffer overflow (CWE-122), CWE-193, in MITRE’s list of common software weaknesses.
It scores 7.8 out of 10 on the Common Vulnerability Scoring System, which rates it high, scored by NVD using CVSS 3.1.[2]
Affected versions
NVD’s record doesn’t list version ranges for it; Sudo’s advisory has them[3]. CISA names the product as Sudo Sudo.
Most families won’t have Sudo; it’s for whoever looks after IT at work.
Exploitation
CISA added it to its catalog of known exploited vulnerabilities on 6 Apr 2022, 435 days after it was made public. CISA lists a flaw only when it has reliable evidence of it being exploited, and gave US federal agencies until 27 Apr 2022 to fix it.[1]
FIRST’s Exploit Prediction Scoring System, which estimates how likely a flaw is to be used in attacks in the next 30 days from what it sees across the internet, puts it at over 99%. That’s in the top 1% of the flaws it scores.[4]
CISA assesses it as not automatable: each attack takes some work.
CISA doesn’t say who was attacked, or how.
Fix
Sudo has published a fix or advice.[3] CISA’s required action: “Apply updates per vendor instructions.”[1]
- Check whether you use it.Sudo is business software or equipment, so most families won’t have it. If you run a business, or work from home on company equipment, ask whoever looks after your IT.
- Send this page to your IT person.Ask them to confirm it’s fixed, or not in use. CISA gave US government agencies until 27 Apr 2022 to fix it.
- If it can’t be fixed, take it offline.CISA’s advice when there’s no fix is to stop using the product, or take it off the internet, until there is one.
You can’t fix someone else’s server, but you can watch for what follows a break-in like this: a breach notice, a password reset you didn’t ask for, or a scam message that knows things it shouldn’t. HARD watches for those for you and your family.
Timeline
| Date | Event |
|---|---|
| The flaw is made public in the National Vulnerability Database, with a severity score of 7.8.[2] | |
| CISA adds it to its catalog of flaws known to be used in attacks.[1] | |
| CISA’s deadline for US government agencies to fix it.[1] | |
| FIRST puts the odds of it being used in attacks in the next 30 days at over 99%.[4] |
See also
Other Sudo flaws
- CVE-2025-32463: inclusion of functionality from untrusted control sphere ·
Other heap buffer overflow flaws
- CVE-2026-94127, F5 BIG-IP APM: heap-based buffer overflow ·
- CVE-2025-25249, Fortinet products: heap-based buffer overflow ·
- CVE-2026-85880, Microsoft Windows: heap-based buffer overflow ·
- CVE-2025-32706, Microsoft Windows: common log file system (CLFS) driver heap-based buffer overflow ·
- CVE-2025-24993, Microsoft Windows: NTFS heap-based buffer overflow ·
Added the same day
- CVE-2021-31166, Microsoft HTTP Protocol Stack: remote code execution ·
- CVE-2017-0148, Microsoft SMBv1 server: remote code execution ·
References
- ^ Cybersecurity and Infrastructure Security Agency. “Sudo Heap-Based Buffer Overflow Vulnerability”. Known Exploited Vulnerabilities Catalog, added 6 Apr 2022.
- ^ National Institute of Standards and Technology. “CVE-2021-3156 Detail”. National Vulnerability Database, published 26 Jan 2021.
- ^ Sudo. Advisories and fixes: lists.fedoraproject.org, lists.fedoraproject.org, oracle.com, oracle.com, oracle.com, and 1 more on NVD’s record.
- ^ FIRST. “Exploit Prediction Scoring System”. EPSS 1.000, percentile 100.0, 31 Oct 2026.
- CVE Program. “CVE-2021-3156”. The official CVE record.
This article is built from CISA’s catalog (version 2026.10.30), NVD’s record and FIRST’s scores, kept in HARD’s database and checked every morning. The plain English is HARD’s.

