CVE-2021-3156 Sudo Heap-Based Buffer Overflow Vulnerability
Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.
From the CISA KEV catalogue version 2026.11.06, with Cybergen analysis. Updated 6 Nov 2026.
Should You Worry?
- CISA confirmed exploitation in the wild and added it to the Known Exploited Vulnerabilities catalogue on 6 Apr 2022.
- Rated High severity (CVSS 7.8, scored by CISA).
- It has been in the catalogue for 1,675 days. Systems still unpatched now have almost certainly been scanned for it.
What It Is
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.
What To Do Now
- 1
Find it
Search your asset inventory and external attack surface for Sudo. Include cloud images, appliances and anything a supplier runs for you.
Attack Surface Management - 2
- 3
Hunt for compromise
If an affected system was reachable before you patched, assume it may have been hit. Check logs, new accounts, web shells and outbound connections from the date of exposure.
Incident Response - 4
Prove it is fixed
Rescan or test the system after patching. Upgrades that fail silently and forgotten secondary instances are common.
Penetration Testing
Vendor Advisories
The Compliance Clock
General guidance, not legal advice. Your obligations depend on your sector, scope and jurisdiction.
Not Sure If You Are Exposed?
Our attack surface and vulnerability teams can check your internet-facing estate for CVE-2021-3156 and every other exploited flaw on the list.
Sources
- CISA Known Exploited Vulnerabilities catalogue
- NVD: CVE-2021-3156
- CVE record: CVE-2021-3156
- FIRST EPSS
- lists.debian.org/debian-lts-announce/2021/01/msg00022.html
- seclists.org/fulldisclosure/2021/Jan/79
- openwall.com/lists/oss-security/2021/01/26/3
- security.gentoo.org/glsa/202101-33
- debian.org/security/2021/dsa-4839
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQB
- openwall.com/lists/oss-security/2021/01/27/1
