CVE-2021-3156
7.8, high Known exploitedSudo Heap-Based Buffer Overflow Vulnerability
- CVSS
- 7.8, high high CVSS v3.1
- EPSS, next 30 days
- 100% higher than 99.9% of scored CVEs
- Exploitation
- Confirmed in the wild
- Published
- 26 Jan 20215 years ago
Known exploited
CISA added this to the Known Exploited Vulnerabilities Catalog on 6 Apr 2022. US federal agencies had to remediate by 27 Apr 2022, a deadline that has passed.
Required action. Apply updates per vendor instructions.
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.
Details
- Vendor
- Sudo and 7 more
- Product
- Sudo
- Weakness
- CWE-193 (opens in a new tab)
- Status
- Analyzed
- Updated
- 17 Jun 2026
- Assigner
- cve@mitre.org
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References 35
Exploit code 13
- packetstormsecurity.com /files/161160/Sudo-Heap-Based-Buffer-Overflow.html (opens in a new tab)
- packetstormsecurity.com /files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html (opens in a new tab)
- packetstormsecurity.com /files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html (opens in a new tab)
- packetstormsecurity.com /files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html (opens in a new tab)
- packetstormsecurity.com /files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html (opens in a new tab)
- seclists.org /fulldisclosure/2021/Feb/42 (opens in a new tab)
- seclists.org /fulldisclosure/2021/Jan/79 (opens in a new tab)
- seclists.org /fulldisclosure/2024/Feb/3 (opens in a new tab)
5 more
- openwall.com /lists/oss-security/2021/01/26/3 (opens in a new tab)
- openwall.com /lists/oss-security/2021/02/15/1 (opens in a new tab)
- openwall.com /lists/oss-security/2024/01/30/6 (opens in a new tab)
- openwall.com /lists/oss-security/2021/01/26/3 (opens in a new tab)
- vicarius.io /vsociety/posts/sudoedit-pwned-cve-2021-3156 (opens in a new tab)
Patches and fixes 4
Advisories 14
- openwall.com /lists/oss-security/2021/01/27/1 (opens in a new tab)
- openwall.com /lists/oss-security/2021/01/27/2 (opens in a new tab)
- openwall.com /lists/oss-security/2024/01/30/8 (opens in a new tab)
- kc.mcafee.com /corporate/index?page=content&id=SB10348 (opens in a new tab)
- lists.debian.org /debian-lts-announce/2021/01/msg00022.html (opens in a new tab)
- security.gentoo.org /glsa/202101-33 (opens in a new tab)
- security.netapp.com /advisory/ntap-20210128-0001/ (opens in a new tab)
- security.netapp.com /advisory/ntap-20210128-0002/ (opens in a new tab)
6 more
- support.apple.com /kb/HT212177 (opens in a new tab)
- tools.cisco.com /security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM (opens in a new tab)
- beyondtrust.com /blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability (opens in a new tab)
- debian.org /security/2021/dsa-4839 (opens in a new tab)
- kb.cert.org /vuls/id/794544 (opens in a new tab)
- synology.com /security/advisory/Synology_SA_21_02 (opens in a new tab)
Other references 4
- lists.fedoraproject.org /archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/ (opens in a new tab)
- lists.fedoraproject.org /archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/ (opens in a new tab)
- cisa.gov /known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156 (opens in a new tab)
- sudo.ws /stable.html#1.9.5p2 (opens in a new tab)
The kind is read from NVD's tags where present and from the shape of the URL otherwise, so treat it as a hint.
Other Sudo CVEs
Every Sudo CVE we holdSame vendor in what we hold, not a known link between the flaws.
- CVE-2025-32463 Sudo Inclusion of Functionality from Untrusted Control Sphere Vulnerability KEV EPSS 55% 7.8, high
Beyond this page
Is CVE-2021-3156 in your network?
This page tells you how dangerous CVE-2021-3156 is out there. Whether it sits on one of your devices, only a scan of your own network can tell. That is what our systems do, every day, for the companies we protect.
CVE-2021-3156 is in the CISA catalogue of exploited vulnerabilities: attackers are already exploiting it.
-
EXYS7600 OCELOT
Find it before attackers do
Ocelot scans your network on a schedule and reports every vulnerability it finds by its CVE identifier, with its CVSS score and how many of your hosts are affected. A finding like CVE-2021-3156 comes with the devices to patch.
Learn more about EXYS7600 OCELOT -
EXYS7950 KONDRA
Detect it if it's exploited
Until the patch is applied, Kondra monitors your network, events and endpoints in real time. It keeps an inventory of the software installed on every endpoint, and its anomaly detection rules flag what an attacker does once inside.
Learn more about EXYS7950 KONDRA
Assembled from the NVD 2.0 API, the CISA Known Exploited Vulnerabilities Catalog and FIRST EPSS. Scores are as of our last collection on 18 Oct 2026, not the live upstream state.