{"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-07-08T05:59:12.314299609Z","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"],"database_specific":{"unresolved_ranges":[{"vendor_product":"beyondtrust:privilege_management_for_mac","cpes":["cpe:2.3:a:beyondtrust:privilege_management_for_mac:*:*:*:*:*:*:*:*"],"extracted_events":[{"fixed":"21.1.1"}],"source":"CPE_RANGE"},{"extracted_events":[{"fixed":"10.3.2-10"}],"source":"CPE_RANGE","vendor_product":"beyondtrust:privilege_management_for_unix/linux","cpes":["cpe:2.3:a:beyondtrust:privilege_management_for_unix\\/linux:*:*:*:*:basic:*:*:*"]},{"extracted_events":[{"introduced":"10.3.0.0.0"},{"last_affected":"10.3.0.2.1"},{"introduced":"10.4.0.1.0"},{"last_affected":"10.4.0.3.1"}],"source":"CPE_RANGE","vendor_product":"oracle:communications_performance_intelligence_center","cpes":["cpe:2.3:a:oracle:communications_performance_intelligence_center:*:*:*:*:*:*:*:*"]},{"cpes":["cpe:2.3:o:oracle:micros_es400_firmware:*:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"400"},{"last_affected":"410"}],"source":"CPE_RANGE","vendor_product":"oracle:micros_es400_firmware"},{"source":"CPE_RANGE","vendor_product":"oracle:micros_workstation_6_firmware","cpes":["cpe:2.3:o:oracle:micros_workstation_6_firmware:*:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"610"},{"last_affected":"655"}]},{"cpes":["cpe:2.3:a:oracle:tekelec_platform_distribution:*:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"7.4.0"},{"last_affected":"7.7.1"}],"source":"CPE_RANGE","vendor_product":"oracle:tekelec_platform_distribution"},{"cpes":["cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"9.0"},{"last_affected":"9.0"},{"introduced":"10.0"},{"last_affected":"10.0"}],"source":"CPE_STRING","vendor_product":"debian:debian_linux"},{"vendor_product":"fedoraproject:fedora","cpes":["cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*","cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"32"},{"last_affected":"32"},{"introduced":"33"},{"last_affected":"33"}],"source":"CPE_STRING"},{"cpes":["cpe:2.3:a:mcafee:web_gateway:10.0.4:*:*:*:*:*:*:*","cpe:2.3:a:mcafee:web_gateway:8.2.17:*:*:*:*:*:*:*","cpe:2.3:a:mcafee:web_gateway:9.2.8:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"8.2.17"},{"last_affected":"8.2.17"},{"introduced":"9.2.8"},{"last_affected":"9.2.8"},{"introduced":"10.0.4"},{"last_affected":"10.0.4"}],"source":"CPE_STRING","vendor_product":"mcafee:web_gateway"},{"extracted_events":[{"introduced":"9"},{"last_affected":"9"}],"source":"CPE_STRING","vendor_product":"netapp:ontap_tools","cpes":["cpe:2.3:a:netapp:ontap_tools:9:*:*:*:*:vmware_vsphere:*:*"]},{"extracted_events":[{"introduced":"310"},{"last_affected":"310"}],"source":"CPE_STRING","vendor_product":"oracle:micros_compact_workstation_3_firmware","cpes":["cpe:2.3:o:oracle:micros_compact_workstation_3_firmware:310:*:*:*:*:*:*:*"]},{"cpes":["cpe:2.3:o:oracle:micros_kitchen_display_system_firmware:210:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"210"},{"last_affected":"210"}],"source":"CPE_STRING","vendor_product":"oracle:micros_kitchen_display_system_firmware"},{"cpes":["cpe:2.3:o:oracle:micros_workstation_5a_firmware:5a:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"5a"},{"last_affected":"5a"}],"source":"CPE_STRING","vendor_product":"oracle:micros_workstation_5a_firmware"},{"extracted_events":[{"introduced":"6.2"},{"last_affected":"6.2"}],"source":"CPE_STRING","vendor_product":"synology:diskstation_manager","cpes":["cpe:2.3:o:synology:diskstation_manager:6.2:*:*:*:*:*:*:*"]},{"vendor_product":"synology:diskstation_manager_unified_controller","cpes":["cpe:2.3:a:synology:diskstation_manager_unified_controller:3.0:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"3.0"},{"last_affected":"3.0"}],"source":"CPE_STRING"}]},"references":[{"type":"WEB","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156"},{"type":"ADVISORY","url":"http://seclists.org/fulldisclosure/2021/Feb/42"},{"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":"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.sudo.ws/stable.html#1.9.5p2"},{"type":"ADVISORY","url":"https://www.synology.com/security/advisory/Synology_SA_21_02"},{"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://www.openwall.com/lists/oss-security/2024/01/30/8"},{"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/millert/sudo","events":[{"introduced":"82d8358a72b1e8784b5399c1ecb5d271ae91e125"},{"fixed":"caa666c2dfa1f4286ccfbed5e512432665b72d3a"},{"introduced":"83d1bee918147a57804de77d3e1064a4e323f47e"},{"fixed":"10d072a320c885e2e805ef2e47fe7a2ebde68abc"},{"introduced":"10d072a320c885e2e805ef2e47fe7a2ebde68abc"},{"last_affected":"8a0373679a24306a2dc57677dbc6d87d1611c8bc"}],"database_specific":{"cpe":["cpe:2.3:a:sudo_project:sudo:*:*:*:*:*:*:*:*","cpe:2.3:a:sudo_project:sudo:1.9.5:-:*:*:*:*:*:*","cpe:2.3:a:sudo_project:sudo:1.9.5:patch1:*:*:*:*:*:*"],"extracted_events":[{"introduced":"1.8.2"},{"fixed":"1.8.32"},{"introduced":"1.9.0"},{"fixed":"1.9.5"},{"introduced":"1.9.5-NA"},{"last_affected":"1.9.5-NA"},{"introduced":"1.9.5-patch1"},{"last_affected":"1.9.5-patch1"}],"source":["CPE_RANGE","CPE_STRING"]}}],"versions":["1.9.5-NA","1.9.5-patch1","SUDO_1_9_5p1","SUDO_1_9_5","SUDO_1_9_4p2","SUDO_1_9_4p1","SUDO_1_9_4","SUDO_1_9_3p1","SUDO_1_9_3","SUDO_1_9_2","SUDO_1_9_1","SUDO_1_8_31p2","SUDO_1_9_0","SUDO_1_8_31p1","SUDO_1_8_31","SUDO_1_8_30","SUDO_1_8_29","SUDO_1_8_28p1","SUDO_1_8_28","SUDO_1_8_27","SUDO_1_8_26","SUDO_1_8_25p1","SUDO_1_8_25","SUDO_1_8_24","SUDO_1_8_23","SUDO_1_8_22","SUDO_1_8_21p2","SUDO_1_8_21p1","SUDO_1_8_21","SUDO_1_8_20p2","SUDO_1_8_20p1","SUDO_1_8_20","SUDO_1_8_19p2","SUDO_1_8_19p1","SUDO_1_8_19","SUDO_1_8_18p1","SUDO_1_8_18","SUDO_1_8_17p1","SUDO_1_8_17","SUDO_1_8_16","SUDO_1_8_15","SUDO_1_8_14p3","SUDO_1_8_14p1","SUDO_1_8_14","SUDO_1_8_13","SUDO_1_8_12","SUDO_1_8_11p2","SUDO_1_8_11p1","SUDO_1_8_11","SUDO_1_8_10p3","SUDO_1_8_10p2","SUDO_1_8_10p1","SUDO_1_8_10","SUDO_1_8_9p5","SUDO_1_8_9p4","SUDO_1_8_9p3","SUDO_1_8_9p2","SUDO_1_8_9p1","SUDO_1_8_9","SUDO_1_8_8","SUDO_1_8_7","SUDO_1_8_6p8","SUDO_1_8_6p7","SUDO_1_8_6p6","SUDO_1_8_6p5","SUDO_1_8_6p4","SUDO_1_8_6p3","SUDO_1_8_6p2","SUDO_1_8_6p1","SUDO_1_8_6","SUDO_1_8_5p3","SUDO_1_8_5p2","SUDO_1_8_5p1","SUDO_1_8_5","SUDO_1_8_4p5","SUDO_1_8_4p4","SUDO_1_8_4p3","SUDO_1_8_4p2","SUDO_1_8_4p1","SUDO_1_8_4","SUDO_1_8_3","SUDO_1_8_2"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3156.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/sudo-project/sudo","events":[{"introduced":"82d8358a72b1e8784b5399c1ecb5d271ae91e125"},{"fixed":"caa666c2dfa1f4286ccfbed5e512432665b72d3a"},{"introduced":"83d1bee918147a57804de77d3e1064a4e323f47e"},{"fixed":"10d072a320c885e2e805ef2e47fe7a2ebde68abc"},{"introduced":"10d072a320c885e2e805ef2e47fe7a2ebde68abc"},{"last_affected":"8a0373679a24306a2dc57677dbc6d87d1611c8bc"}],"database_specific":{"extracted_events":[{"introduced":"1.8.2"},{"fixed":"1.8.32"},{"introduced":"1.9.0"},{"fixed":"1.9.5"},{"introduced":"1.9.5-NA"},{"last_affected":"1.9.5-NA"},{"introduced":"1.9.5-patch1"},{"last_affected":"1.9.5-patch1"}],"source":["CPE_RANGE","CPE_STRING"],"cpe":["cpe:2.3:a:sudo_project:sudo:*:*:*:*:*:*:*:*","cpe:2.3:a:sudo_project:sudo:1.9.5:-:*:*:*:*:*:*","cpe:2.3:a:sudo_project:sudo:1.9.5:patch1:*:*:*:*:*:*"]}}],"versions":["1.9.5-NA","1.9.5-patch1","v1.9.5p1","SUDO_1_9_5p1","v1.9.5","SUDO_1_9_5","v1.9.4p2","SUDO_1_9_4p2","v1.9.4p1","SUDO_1_9_4p1","v1.9.4","SUDO_1_9_4","v1.9.3p1","SUDO_1_9_3p1","v1.9.3","SUDO_1_9_3","v1.9.2","SUDO_1_9_2","v1.9.1","SUDO_1_9_1","v1.8.31p2","SUDO_1_8_31p2","v1.9.0","SUDO_1_9_0","v1.8.31p1","SUDO_1_8_31p1","v1.8.31","SUDO_1_8_31","v1.8.30","SUDO_1_8_30","v1.8.29","SUDO_1_8_29","v1.8.28p1","SUDO_1_8_28p1","v1.8.28","SUDO_1_8_28","v1.8.27","SUDO_1_8_27","v1.8.26","SUDO_1_8_26","v1.8.25p1","SUDO_1_8_25p1","v1.8.25","SUDO_1_8_25","v1.8.24","SUDO_1_8_24","v1.8.23","SUDO_1_8_23","v1.8.22","SUDO_1_8_22","v1.8.21p2","SUDO_1_8_21p2","v1.8.21p1","SUDO_1_8_21p1","v1.8.21","SUDO_1_8_21","v1.8.20p2","SUDO_1_8_20p2","v1.8.20p1","SUDO_1_8_20p1","v1.8.20","SUDO_1_8_20","v1.8.19p2","SUDO_1_8_19p2","v1.8.19p1","SUDO_1_8_19p1","v1.8.19","SUDO_1_8_19","v1.8.18p1","SUDO_1_8_18p1","v1.8.18","SUDO_1_8_18","v1.8.17p1","SUDO_1_8_17p1","v1.8.17","SUDO_1_8_17","v1.8.16","SUDO_1_8_16","v1.8.15","SUDO_1_8_15","v1.8.14p3","SUDO_1_8_14p3","v1.8.14p1","SUDO_1_8_14p1","v1.8.14","SUDO_1_8_14","v1.8.13","SUDO_1_8_13","v1.8.12","SUDO_1_8_12","v1.8.11p2","SUDO_1_8_11p2","v1.8.11p1","SUDO_1_8_11p1","v1.8.11","SUDO_1_8_11","v1.8.10p3","SUDO_1_8_10p3","v1.8.10p2","SUDO_1_8_10p2","v1.8.10p1","SUDO_1_8_10p1","v1.8.10","SUDO_1_8_10","v1.8.9p5","SUDO_1_8_9p5","v1.8.9p4","SUDO_1_8_9p4","v1.8.9p3","SUDO_1_8_9p3","v1.8.9p2","SUDO_1_8_9p2","v1.8.9p1","SUDO_1_8_9p1","v1.8.9","SUDO_1_8_9","v1.8.8","SUDO_1_8_8","v1.8.7","SUDO_1_8_7","v1.8.6p8","SUDO_1_8_6p8","v1.8.6p7","SUDO_1_8_6p7","v1.8.6p6","SUDO_1_8_6p6","v1.8.6p5","SUDO_1_8_6p5","v1.8.6p4","SUDO_1_8_6p4","v1.8.6p3","SUDO_1_8_6p3","v1.8.6p2","SUDO_1_8_6p2","v1.8.6p1","SUDO_1_8_6p1","v1.8.6","SUDO_1_8_6","v1.8.5p3","SUDO_1_8_5p3","v1.8.5p2","SUDO_1_8_5p2","v1.8.5p1","SUDO_1_8_5p1","v1.8.5","SUDO_1_8_5","v1.8.4p5","SUDO_1_8_4p5","v1.8.4p4","SUDO_1_8_4p4","v1.8.4p3","SUDO_1_8_4p3","v1.8.4p2","SUDO_1_8_4p2","v1.8.4p1","SUDO_1_8_4p1","v1.8.4","SUDO_1_8_4","v1.8.3","SUDO_1_8_3","v1.8.2","SUDO_1_8_2"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3156.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}