{"id":"CVE-2021-3156","details":"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.","modified":"2026-04-16T00:03:45.986620287Z","published":"2021-01-26T21:15:12.987Z","related":["SUSE-SU-2021:0225-1","SUSE-SU-2021:0226-1","SUSE-SU-2021:0227-1","SUSE-SU-2021:0232-1","SUSE-SU-2021:0928-1","SUSE-SU-2021:1267-1","SUSE-SU-2021:1273-1","SUSE-SU-2021:1274-1","SUSE-SU-2021:1275-1","SUSE-SU-2024:4389-1","openSUSE-SU-2021:0169-1","openSUSE-SU-2021:0170-1","openSUSE-SU-2021:0602-1","openSUSE-SU-2024:11413-1"],"references":[{"type":"WEB","url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348"},{"type":"WEB","url":"https://www.kb.cert.org/vuls/id/794544"},{"type":"WEB","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156"},{"type":"ADVISORY","url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html"},{"type":"ADVISORY","url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html"},{"type":"ADVISORY","url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html"},{"type":"ADVISORY","url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html"},{"type":"ADVISORY","url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html"},{"type":"ADVISORY","url":"http://seclists.org/fulldisclosure/2021/Feb/42"},{"type":"ADVISORY","url":"http://seclists.org/fulldisclosure/2021/Jan/79"},{"type":"ADVISORY","url":"http://seclists.org/fulldisclosure/2024/Feb/3"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2021/01/27/1"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2021/01/27/2"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2021/02/15/1"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2021/09/14/2"},{"type":"ADVISORY","url":"https://kc.mcafee.com/corporate/index?page=content&id=SB10348"},{"type":"ADVISORY","url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202101-33"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20210128-0001/"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20210128-0002/"},{"type":"ADVISORY","url":"https://support.apple.com/kb/HT212177"},{"type":"ADVISORY","url":"https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM"},{"type":"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"},{"type":"ADVISORY","url":"https://www.debian.org/security/2021/dsa-4839"},{"type":"ADVISORY","url":"https://www.kb.cert.org/vuls/id/794544"},{"type":"ADVISORY","url":"https://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"ADVISORY","url":"https://www.oracle.com//security-alerts/cpujul2021.html"},{"type":"ADVISORY","url":"https://www.oracle.com/security-alerts/cpuapr2022.html"},{"type":"ADVISORY","url":"https://www.oracle.com/security-alerts/cpuoct2021.html"},{"type":"ADVISORY","url":"https://www.sudo.ws/stable.html#1.9.5p2"},{"type":"ADVISORY","url":"https://www.synology.com/security/advisory/Synology_SA_21_02"},{"type":"ADVISORY","url":"https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156"},{"type":"FIX","url":"http://www.openwall.com/lists/oss-security/2021/09/14/2"},{"type":"FIX","url":"https://www.oracle.com//security-alerts/cpujul2021.html"},{"type":"FIX","url":"https://www.oracle.com/security-alerts/cpuapr2022.html"},{"type":"FIX","url":"https://www.oracle.com/security-alerts/cpuoct2021.html"},{"type":"ARTICLE","url":"http://seclists.org/fulldisclosure/2021/Feb/42"},{"type":"ARTICLE","url":"http://seclists.org/fulldisclosure/2021/Jan/79"},{"type":"ARTICLE","url":"http://seclists.org/fulldisclosure/2024/Feb/3"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2021/01/27/1"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2021/01/27/2"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2021/02/15/1"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2021/09/14/2"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2024/01/30/6"},{"type":"ARTICLE","url":"http://www.openwall.com/lists/oss-security/2024/01/30/8"},{"type":"ARTICLE","url":"https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html"},{"type":"ARTICLE","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/"},{"type":"ARTICLE","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/"},{"type":"ARTICLE","url":"https://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"EVIDENCE","url":"http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html"},{"type":"EVIDENCE","url":"http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html"},{"type":"EVIDENCE","url":"http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html"},{"type":"EVIDENCE","url":"http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html"},{"type":"EVIDENCE","url":"http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html"},{"type":"EVIDENCE","url":"http://seclists.org/fulldisclosure/2021/Jan/79"},{"type":"EVIDENCE","url":"http://seclists.org/fulldisclosure/2024/Feb/3"},{"type":"EVIDENCE","url":"http://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"EVIDENCE","url":"http://www.openwall.com/lists/oss-security/2021/02/15/1"},{"type":"EVIDENCE","url":"http://www.openwall.com/lists/oss-security/2024/01/30/6"},{"type":"EVIDENCE","url":"https://www.openwall.com/lists/oss-security/2021/01/26/3"},{"type":"EVIDENCE","url":"https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/golang/go","events":[{"introduced":"0"},{"fixed":"f69b0c627f94b7dcaf4ec654df8e0ffa4bf46957"}]}],"versions":["go1.3beta1","go1.3beta2","go1.4beta1","go1.5beta1","go1.5beta2","go1.5beta3","go1.6beta1","go1.6beta2","go1.7beta1","go1.7beta2","go1.7rc1","go1.7rc2","go1.7rc3","go1.7rc4","go1.8beta1","go1.8beta2","go1.9","go1.9.1","go1.9.2","go1.9.3","go1.9.4","go1.9beta1","go1.9beta2","go1.9rc1","go1.9rc2","release.r56","weekly","weekly.2009-11-06","weekly.2009-11-10","weekly.2009-11-10.1","weekly.2009-11-12","weekly.2009-11-17","weekly.2009-12-07","weekly.2009-12-09","weekly.2009-12-22","weekly.2010-01-05","weekly.2010-01-13","weekly.2010-01-27","weekly.2010-02-04","weekly.2010-02-17","weekly.2010-02-23","weekly.2010-03-04","weekly.2010-03-15","weekly.2010-03-22","weekly.2010-03-30","weekly.2010-04-13","weekly.2010-04-27","weekly.2010-05-04","weekly.2010-05-27","weekly.2010-06-09","weekly.2010-06-21","weekly.2010-07-01","weekly.2010-07-14","weekly.2010-07-29","weekly.2010-08-04","weekly.2010-08-11","weekly.2010-08-25","weekly.2010-09-06","weekly.2010-09-15","weekly.2010-09-22","weekly.2010-09-29","weekly.2010-10-13","weekly.2010-10-13.1","weekly.2010-10-20","weekly.2010-10-27","weekly.2010-11-02","weekly.2010-11-10","weekly.2010-11-23","weekly.2010-12-02","weekly.2010-12-08","weekly.2010-12-15","weekly.2010-12-15.1","weekly.2010-12-22","weekly.2011-01-06","weekly.2011-01-12","weekly.2011-01-19","weekly.2011-01-20","weekly.2011-02-01","weekly.2011-02-01.1","weekly.2011-02-15","weekly.2011-02-24","weekly.2011-03-07","weekly.2011-03-07.1","weekly.2011-03-15","weekly.2011-03-28","weekly.2011-04-04","weekly.2011-04-13","weekly.2011-04-27","weekly.2011-05-22","weekly.2011-06-02","weekly.2011-06-09","weekly.2011-06-16","weekly.2011-06-23","weekly.2011-07-07","weekly.2011-07-19","weekly.2011-07-29","weekly.2011-08-10","weekly.2011-08-17","weekly.2011-09-01","weekly.2011-09-07","weekly.2011-09-16","weekly.2011-09-21","weekly.2011-10-06","weekly.2011-10-18","weekly.2011-10-25","weekly.2011-10-26","weekly.2011-11-01","weekly.2011-11-02","weekly.2011-11-08","weekly.2011-11-09","weekly.2011-11-18","weekly.2011-12-01","weekly.2011-12-02","weekly.2011-12-06","weekly.2011-12-14","weekly.2011-12-22","weekly.2012-01-15","weekly.2012-01-20","weekly.2012-01-27","weekly.2012-02-07","weekly.2012-02-14","weekly.2012-02-22","weekly.2012-03-04","weekly.2012-03-13","weekly.2012-03-22","weekly.2012-03-27"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-3156.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/millert/sudo","events":[{"introduced":"82d8358a72b1e8784b5399c1ecb5d271ae91e125"},{"fixed":"caa666c2dfa1f4286ccfbed5e512432665b72d3a"},{"introduced":"83d1bee918147a57804de77d3e1064a4e323f47e"},{"fixed":"10d072a320c885e2e805ef2e47fe7a2ebde68abc"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-3156.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}