{"id":"CVE-2021-3156","url":"https://www.cyber-defence.io/tools/cve/CVE-2021-3156","generatedAt":"2026-10-27T23:28:25.104Z","title":"Sudo Heap-Based Buffer Overflow Vulnerability","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.","published":"2021-01-26T21:15:13.000Z","lastModified":"2026-06-17T04:04:46.000Z","status":"Analyzed","sourceIdentifier":"cve@mitre.org","cvss":{"version":"3.1","score":7.8,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"cwe":["CWE-193"],"affected":["sudo project/sudo","fedoraproject/fedora","debian/debian linux","netapp/active iq unified manager","netapp/cloud backup","netapp/hci management node","netapp/oncommand unified manager core package","netapp/ontap select deploy administration utility","netapp/ontap tools","netapp/solidfire","mcafee/web gateway","synology/diskstation manager unified controller","synology/diskstation manager","synology/skynas firmware","synology/vs960hd firmware","beyondtrust/privilege management for mac","beyondtrust/privilege management for unix\\/linux","oracle/micros compact workstation 3 firmware","oracle/micros es400 firmware","oracle/micros kitchen display system firmware","oracle/micros workstation 5a firmware","oracle/micros workstation 6 firmware","oracle/communications performance intelligence center","oracle/tekelec platform distribution"],"epss":{"score":0.99962,"percentile":0.99976,"date":"2026-10-26","history":[]},"kev":{"listed":true,"dateAdded":"2022-04-06","dueDate":"2022-04-27","knownRansomwareCampaignUse":"Unknown","notes":"Apply updates per vendor instructions.\nhttps://nvd.nist.gov/vuln/detail/CVE-2021-3156"},"exploits":{"count":2,"verified":false,"firstPublished":"2021-02-03","source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[{"edbId":49522,"kind":"exploit","title":"Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)","url":"https://www.exploit-db.com/exploits/49522","sourceUrl":"https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/multiple/local/49522.c","file":"exploits/multiple/local/49522.c","published":"2021-02-03","added":"2021-02-03","updated":"2021-02-03","author":"nu11secur1ty","type":"local","platform":"multiple","port":null,"verified":false,"codes":["CVE-2021-3156"],"tags":null,"aliases":null,"applicationUrl":null,"screenshotUrl":null,"referenceUrl":null},{"edbId":49521,"kind":"exploit","title":"Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)","url":"https://www.exploit-db.com/exploits/49521","sourceUrl":"https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/multiple/local/49521.py","file":"exploits/multiple/local/49521.py","published":"2021-02-03","added":"2021-02-03","updated":"2021-02-03","author":"West Shepherd","type":"local","platform":"multiple","port":null,"verified":false,"codes":["CVE-2021-3156"],"tags":null,"aliases":null,"applicationUrl":null,"screenshotUrl":null,"referenceUrl":null}]},"verdict":{"level":"urgent","text":"Known to be exploited in the wild (CISA KEV, CISA remediation deadline 27 April 2022). Treat as an emergency change: patch or isolate now, then hunt for prior compromise."},"changes":[],"references":[{"url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"cve@mitre.org"},{"url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"cve@mitre.org"},{"url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"cve@mitre.org"},{"url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"cve@mitre.org"},{"url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"cve@mitre.org"},{"url":"http://seclists.org/fulldisclosure/2021/Feb/42","tags":["Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://seclists.org/fulldisclosure/2021/Jan/79","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://seclists.org/fulldisclosure/2024/Feb/3","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/1","tags":["Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/2","tags":["Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2021/02/15/1","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2021/09/14/2","tags":["Mailing List","Patch","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/6","tags":["Exploit","Mailing List"],"source":"cve@mitre.org"},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/8","tags":["Mailing List"],"source":"cve@mitre.org"},{"url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348","tags":["Broken Link","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html","tags":["Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/","tags":["Mailing List","Release Notes"],"source":"cve@mitre.org"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/","tags":["Mailing List","Release Notes"],"source":"cve@mitre.org"},{"url":"https://security.gentoo.org/glsa/202101-33","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://security.netapp.com/advisory/ntap-20210128-0001/","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://security.netapp.com/advisory/ntap-20210128-0002/","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://support.apple.com/kb/HT212177","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.beyondtrust.com/blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.debian.org/security/2021/dsa-4839","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.kb.cert.org/vuls/id/794544","tags":["Third Party Advisory","US Government Resource"],"source":"cve@mitre.org"},{"url":"https://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.oracle.com//security-alerts/cpujul2021.html","tags":["Patch","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":["Patch","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["Patch","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.sudo.ws/stable.html#1.9.5p2","tags":["Release Notes"],"source":"cve@mitre.org"},{"url":"https://www.synology.com/security/advisory/Synology_SA_21_02","tags":["Third Party Advisory"],"source":"cve@mitre.org"},{"url":"https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156","tags":["Exploit","Third Party Advisory"],"source":"cve@mitre.org"},{"url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://seclists.org/fulldisclosure/2021/Feb/42","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://seclists.org/fulldisclosure/2021/Jan/79","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://seclists.org/fulldisclosure/2024/Feb/3","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/1","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/2","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2021/02/15/1","tags":["Exploit","Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2021/09/14/2","tags":["Mailing List","Patch","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/6","tags":["Exploit","Mailing List"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/8","tags":["Mailing List"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348","tags":["Broken Link","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/","tags":["Mailing List","Release Notes"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/","tags":["Mailing List","Release Notes"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.gentoo.org/glsa/202101-33","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.netapp.com/advisory/ntap-20210128-0001/","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.netapp.com/advisory/ntap-20210128-0002/","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://support.apple.com/kb/HT212177","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://www.beyondtrust.com/blog/entry/security-advisory-privilege-management-for-unix-linux-pmul-basic-and-privilege-management-for-mac-pmm-affected-by-sudo-vulnerability","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://www.debian.org/security/2021/dsa-4839","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-3156","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}