{"id":"CVE-2021-3156","published":"2021-01-26T21:15:12Z","modified":"2026-06-17T04:04:45Z","title":"Sudo Heap-Based Buffer Overflow Vulnerability","vendor":"Sudo","product":"Sudo","tier":"core","eol":null,"description":{"text":"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.","provenance":"source","from":"NVD"},"summary":{"text":"The Sudo utility (product Sudo, vendor Sudo) contains an off-by-one error in versions before 1.9.5p2 that can cause a heap-based buffer overflow in its handling of the sudoedit -s command-line option. An attacker with a local, low-privileged account can exploit it by supplying an argument ending in a single backslash character to escalate privileges to root, without requiring any user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-23T07:06:09Z"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"NVD"},"epss":{"score":0.99962,"percentile":0.99976,"date":"2026-10-30","provenance":"source"},"kev":{"dateAdded":"2022-04-06","dueDate":"2022-04-27","ransomware":false,"requiredAction":"Apply updates per vendor instructions.","notes":"https://nvd.nist.gov/vuln/detail/CVE-2021-3156","provenance":"source"},"vulncheckKev":{"dateAdded":"2022-04-06","exploitedFirstSeen":"2022-04-06","ransomware":false,"evidence":[{"url":"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json","date":"2022-04-06"},{"url":"https://cisa.gov/news-events/alerts/2022/04/27/2021-top-routinely-exploited-vulnerabilities","date":"2022-04-28"},{"url":"https://cisa.gov/news-events/cybersecurity-advisories/aa22-117a","date":"2022-04-28"},{"url":"https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/ex-cobalt-go-red-tehnika-skrytogo-tunnelya/","date":"2024-06-06"},{"url":"https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/excobalt-gored-the-hidden-tunnel-technique/","date":"2024-06-19"},{"url":"https://securelist.com/vulnerabilities-and-exploits-in-q1-2025/116624/","date":"2025-05-30"},{"url":"https://unit42.paloaltonetworks.com/infiltration-of-global-telecom-networks/","date":"2025-07-29"},{"url":"https://hunt.io/blog/thailand-ministry-finance-targeted-with-hermes-ai-agent","date":"2026-07-23"},{"url":"https://www.recordedfuture.com/blog/july-2026-cve-landscape","date":"2026-08-07"},{"url":"https://blog.talosintelligence.com/uat-10147-chinese-speaking-adversary-integrates-agentic-ai-into-post-compromise-operations/","date":"2026-08-20"}],"evidenceTotal":11,"provenance":"source"},"exploited":true,"otx":{"pulseCount":50,"pulses":[{"name":"Actively_Exploited_Kev | Oct 29, 2026","url":"https://otx.alienvault.com/pulse/6ae20c1db17e7057ae7d9ad1","created":"2026-10-28"},{"name":"Actively_Exploited_Kev | Oct 28, 2026","url":"https://otx.alienvault.com/pulse/6ae0ba7e0e2a97ff7b218819","created":"2026-10-27"},{"name":"Actively_Exploited_Kev | Oct 27, 2026","url":"https://otx.alienvault.com/pulse/6adf68b85c3e852f3c111d18","created":"2026-10-26"},{"name":"Actively_Exploited_Kev | Oct 24, 2026","url":"https://otx.alienvault.com/pulse/6adb740e397c3ad4799aa4cd","created":"2026-10-23"},{"name":"Actively_Exploited_Kev | Oct 23, 2026","url":"https://otx.alienvault.com/pulse/6ada236fcfba2dfa730ea482","created":"2026-10-22"},{"name":"Actively_Exploited_Kev | Oct 22, 2026","url":"https://otx.alienvault.com/pulse/6ad8d33a077cbb5cab524d80","created":"2026-10-21"},{"name":"Actively_Exploited_Kev | Oct 21, 2026","url":"https://otx.alienvault.com/pulse/6ad78130c4d1ac2be83a8b6d","created":"2026-10-20"},{"name":"Actively_Exploited_Kev | Oct 20, 2026","url":"https://otx.alienvault.com/pulse/6ad62f63c24a405a3423cc13","created":"2026-10-19"},{"name":"Actively_Exploited_Kev | Oct 19, 2026","url":"https://otx.alienvault.com/pulse/6ad4dda174e5797d0bd238b7","created":"2026-10-18"},{"name":"Actively_Exploited_Kev | Oct 18, 2026","url":"https://otx.alienvault.com/pulse/6ad38c22e1848f8189d1c121","created":"2026-10-17"}],"provenance":"machine"},"cwes":[{"id":"CWE-193","name":"Off-by-one Error"},{"id":"CWE-122","name":"Heap-based Buffer Overflow"}],"references":[{"url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://seclists.org/fulldisclosure/2021/Feb/42","tags":["Mailing List","Third Party Advisory"]},{"url":"http://seclists.org/fulldisclosure/2021/Jan/79","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://seclists.org/fulldisclosure/2024/Feb/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/1","tags":["Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/2","tags":["Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/02/15/1","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/09/14/2","tags":["Mailing List","Patch","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/6","tags":["Exploit","Mailing List"]},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/8","tags":["Mailing List"]},{"url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348","tags":["Broken Link","Third Party Advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html","tags":["Mailing List","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/","tags":["Mailing List","Release Notes"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/","tags":["Mailing List","Release Notes"]},{"url":"https://security.gentoo.org/glsa/202101-33","tags":["Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20210128-0001/","tags":["Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20210128-0002/","tags":["Third Party Advisory"]},{"url":"https://support.apple.com/kb/HT212177","tags":["Third Party Advisory"]},{"url":"https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM","tags":["Third Party Advisory"]},{"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"]},{"url":"https://www.debian.org/security/2021/dsa-4839","tags":["Third Party Advisory"]},{"url":"https://www.kb.cert.org/vuls/id/794544","tags":["Third Party Advisory","US Government Resource"]},{"url":"https://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"https://www.oracle.com//security-alerts/cpujul2021.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.sudo.ws/stable.html#1.9.5p2","tags":["Release Notes"]},{"url":"https://www.synology.com/security/advisory/Synology_SA_21_02","tags":["Third Party Advisory"]},{"url":"https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156","tags":["Exploit","Third Party Advisory"]},{"url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html","tags":["Exploit","Third Party Advisory","VDB Entry"]},{"url":"http://seclists.org/fulldisclosure/2021/Feb/42","tags":["Mailing List","Third Party Advisory"]},{"url":"http://seclists.org/fulldisclosure/2021/Jan/79","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://seclists.org/fulldisclosure/2024/Feb/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/1","tags":["Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/01/27/2","tags":["Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/02/15/1","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2021/09/14/2","tags":["Mailing List","Patch","Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/6","tags":["Exploit","Mailing List"]},{"url":"http://www.openwall.com/lists/oss-security/2024/01/30/8","tags":["Mailing List"]},{"url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348","tags":["Broken Link","Third Party Advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html","tags":["Mailing List","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/","tags":["Mailing List","Release Notes"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/","tags":["Mailing List","Release Notes"]},{"url":"https://security.gentoo.org/glsa/202101-33","tags":["Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20210128-0001/","tags":["Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20210128-0002/","tags":["Third Party Advisory"]},{"url":"https://support.apple.com/kb/HT212177","tags":["Third Party Advisory"]},{"url":"https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM","tags":["Third Party Advisory"]},{"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"]},{"url":"https://www.debian.org/security/2021/dsa-4839","tags":["Third Party Advisory"]},{"url":"https://www.kb.cert.org/vuls/id/794544","tags":["Third Party Advisory","US Government Resource"]},{"url":"https://www.openwall.com/lists/oss-security/2021/01/26/3","tags":["Exploit","Mailing List","Third Party Advisory"]},{"url":"https://www.oracle.com//security-alerts/cpujul2021.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.sudo.ws/stable.html#1.9.5p2","tags":["Release Notes"]},{"url":"https://www.synology.com/security/advisory/Synology_SA_21_02","tags":["Third Party Advisory"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156","tags":["US Government Resource"]}],"techniques":[{"id":"T1068","name":"Exploitation for Privilege Escalation","tactics":["privilege-escalation"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: Local heap overflow exploited for privilege escalation","mappingType":"exploitation_technique","evidence":[{"from":"description","quote":"allows privilege escalation to root via \"sudoedit -s","start":104,"end":156}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"}],"reports":[{"id":"SRC-cb049733b1fc717427aa","title":"Russian Military Cyber Actors Target U.S. and Global Critical Infrastructure","publisher":"cisa.gov","url":"https://www.cisa.gov/sites/default/files/2024-09/aa24-249a-russian-military-cyber-actors-target-us-and-global-critical-infrastructure.pdf","date":null,"mentions":[{"quote":" CVE-2021-3156 (Red Hat: Privilege Escalation via Command Line Argument Parsing)","start":9829,"end":9910},{"quote":" NIST NVD: CVE-2021-3156","start":36909,"end":36934}]}],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2021-26500","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-26500","exploited":true,"exploitedSince":"2022-04-06","provenance":"source"},"exploits":[{"id":49521,"url":"https://www.exploit-db.com/exploits/49521","title":"Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)","type":"local","platform":"multiple","date":"2021-02-03","verified":false,"provenance":"source"},{"id":49522,"url":"https://www.exploit-db.com/exploits/49522","title":"Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)","type":"local","platform":"multiple","date":"2021-02-03","verified":false,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":2,"earliest":"2021-02-03"},"pocGithub":{"count":72,"skipped":16,"earliest":"2021-01-26","earliestUrl":"https://github.com/mr-r3b00t/CVE-2021-3156","repos":[{"name":"blasty/CVE-2021-3156","url":"https://github.com/blasty/CVE-2021-3156","stars":1031,"created":"2021-01-30"},{"name":"worawit/CVE-2021-3156","url":"https://github.com/worawit/CVE-2021-3156","stars":810,"created":"2021-03-15"},{"name":"stong/CVE-2021-3156","url":"https://github.com/stong/CVE-2021-3156","stars":430,"created":"2021-01-30"},{"name":"LiveOverflow/pwnedit","url":"https://github.com/LiveOverflow/pwnedit","stars":227,"created":"2021-04-29"},{"name":"Rvn0xsy/CVE-2021-3156-plus","url":"https://github.com/Rvn0xsy/CVE-2021-3156-plus","stars":204,"created":"2021-02-09"}]},"metasploit":[{"name":"Sudo Heap-Based Buffer Overflow","module":"exploit/linux/local/sudo_baron_samedit","type":"exploit","disclosureDate":"2021-01-26","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/sudo_baron_samedit.rb"}],"first":{"date":"2021-01-26","source":"PoC-in-GitHub","url":"https://github.com/mr-r3b00t/CVE-2021-3156"},"provenance":"source"},"exploitRefs":["http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html","http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html","http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html","http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html","http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html","http://seclists.org/fulldisclosure/2021/Jan/79","http://seclists.org/fulldisclosure/2024/Feb/3","http://www.openwall.com/lists/oss-security/2021/01/26/3","http://www.openwall.com/lists/oss-security/2021/02/15/1","http://www.openwall.com/lists/oss-security/2024/01/30/6","https://www.openwall.com/lists/oss-security/2021/01/26/3","https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156"],"flow":[{"stage":"exploitation","techniques":["T1068"],"provenance":"ai"}],"timeline":[{"date":"2021-01-26","kind":"published","label":"Published (NVD)","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-3156","provenance":"source"},{"date":"2021-01-26","kind":"exploit-public","label":"First public exploit: PoC-in-GitHub; later: Metasploit 2021-01-26, Exploit-DB 2021-02-03","url":"https://github.com/mr-r3b00t/CVE-2021-3156","provenance":"source"},{"date":"2022-04-06","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json","provenance":"source"},{"date":"2022-04-06","kind":"kev","label":"Added to CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","provenance":"source"},{"date":"2022-04-06","kind":"euvd-exploited","label":"ENISA EUVD: exploited","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-26500","provenance":"source"}],"speed":{"daysToPublicExploit":0,"firstExploitFrom":"PoC-in-GitHub","daysToKev":435},"priority":{"score":72.3,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in CISA KEV and VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 1669 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":20.0,"detail":"percentile 0.9998"},{"name":"Named in threat reports","points":3.87,"detail":"1 report"},{"name":"Public exploit code","points":5.0,"detail":"12 NVD references tagged Exploit; 2 Exploit-DB entries; 72 PoC-in-GitHub repos; 1 Metasploit module"},{"name":"Mentioned in OTX pulses","points":3.0,"detail":"50 pulses"},{"name":"CVSS severity","points":5.46,"detail":"base score 7.8"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}