CVE-2021-3156

high

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.

References

https://github.com/turab-usmani/cve-backport

https://github.com/leosp1983/cve-redhat

https://github.com/keenglomerate/bastion_ai

https://github.com/WhatsWrongAndWhy/CVE-2021-3156

https://github.com/Athology0000/cve-lab

https://github.com/IJBaig/CVE-2021-3156

https://github.com/RaffayAKhan/CVE-Threat-Analysis-and-Risk-Assessment

https://github.com/Kranti08/CVE-2021-3156-Baron-Samedit

https://github.com/philip-xx695/privscan

https://github.com/Robblackcatchai/porfolio-Baron-Samedit

https://github.com/yashmoar11/RAG-poison

https://github.com/nextgensoumen/soc-pulse

https://github.com/sayhi13/CVE-explanations

https://github.com/musanmaz/BoxGuard

https://github.com/Andyyyyuan/CVE-Poc

https://github.com/chiranths09/Syntecxhub_Project_Vulnerability-CVE-Scanner

https://github.com/Rana-Ali93/CVE-2021-3156-Sudo-Buffer-Overflow-Linux

https://github.com/TheLeopard65/CVE-2021-3156-Baron-Samedit

https://github.com/strikoder/LinEnum-ng

https://github.com/SyedNabeel98/CVE-writeups

https://github.com/ZeroPathAI/zeropath-ctf

https://github.com/Npg-1/CVE_Website

https://github.com/Marquez-K/GitHub_Search_CVE

https://github.com/daniel7-li/cve-scanner

https://github.com/Syedomershah99/CVE-semantic-IEEE

https://github.com/VilmarTuminskii/cve-2021-3156-sudo-lab

https://github.com/SWORDIntel/FASTPORT

https://github.com/HuzaifaTariqAfzalKhan/CVE-Exploit-Research-Development-ITSOLERA

https://github.com/zharkaron/cve-2025-zharkaron

https://github.com/Maalfer/Sudo-CVE-2021-3156

https://github.com/ZacharyKirkeby/CVE_a_Week

https://github.com/schoi1337/dockout

https://github.com/Shuhaib88/Baron-Samedit-Heap-Buffer-Overflow-CVE-2021-3156

https://github.com/jlucas8/cve-test-scripts

https://github.com/duongdz96/CVE-2021-3156-main

https://github.com/PuddinCat/GithubRepoSpider

https://github.com/Sornphut/CVE-2021-3156-Heap-Based-Buffer-Overflow-in-Sudo-Baron-Samedit-

https://github.com/hungnqdz/cve

https://github.com/mtai83/khai-th-c-CVE

https://github.com/Bad3r/CVE-2021-3156-without-ip-command

https://github.com/gek64/cve

https://github.com/0xddhub/data

https://github.com/h0pe-ay/Vulnerability-Reproduction

https://github.com/0x4ndy/clif

https://github.com/FrancescoMarchiori/CVE-2021-3156

https://github.com/ypl6/heaplens

https://github.com/RodricBr/CVE-2021-3156

https://github.com/GatoGamer1155/CVE-2021-3156

https://github.com/barebackbandit/CVE-2021-3156

https://github.com/ret2basic/sudoscience

https://github.com/ret2basic/SudoScience

https://github.com/litt1eb0yy/CVE-2021-3156

https://github.com/sharkmoos/Baron-Samedit

https://github.com/halissha/CVE-2021-3156

https://github.com/Bubleh21/CVE-2021-3156

https://github.com/redhawkeye/sudo-exploit

https://github.com/LiveOverflow/pwnedit

https://github.com/Nokialinux/CVE-2021-3156

https://github.com/BearCat4/CVE-2021-3156

https://github.com/lmol/CVE-2021-3156

https://github.com/r3k4t/how-to-solve-sudo-heap-based-bufferoverflow-vulnerability

https://github.com/0xdevil/CVE-2021-3156

https://github.com/perlun/sudo-1.8.3p1-patched

https://github.com/dinhbaouit/CVE-2021-3156

https://github.com/TheSerialiZator/CTF-2021

https://github.com/DanielAzulayy/CTF-2021

https://github.com/DanielAzulay9/CTF-2021

https://github.com/AbdullahRizwan101/Baron-Samedit

https://github.com/Ashish-dawani/CVE-2021-3156-Patch

https://github.com/voidlsd/CVE-2021-3156

https://github.com/apogiatzis/docker-CVE-2021-3156

https://github.com/mbcrump/CVE-2021-3156

https://github.com/ph4ntonn/CVE-2021-3156

https://github.com/ymrsmns/CVE-2021-3156

https://github.com/reverse-ex/CVE-2021-3156

https://www.vicarius.io/vsociety/posts/sudoedit-pwned-cve-2021-3156

https://www.sudo.ws/stable.html#1.9.5p2

https://www.openwall.com/lists/oss-security/2021/01/26/3

https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156

https://kc.mcafee.com/corporate/index?page=content&id=SB10348

http://www.openwall.com/lists/oss-security/2024/01/30/8

http://www.openwall.com/lists/oss-security/2024/01/30/6

http://www.openwall.com/lists/oss-security/2021/02/15/1

http://www.openwall.com/lists/oss-security/2021/01/26/3

http://seclists.org/fulldisclosure/2024/Feb/3

http://seclists.org/fulldisclosure/2021/Jan/79

http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html

http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html

http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html

http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html

http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html

Details

Source: Mitre, NVD

Published: 2021-01-26

Updated: 2026-06-17

Named Vulnerability: Baron SameditKnown Exploited Vulnerability (KEV)

Risk Information

CVSS v2

Base Score: 7.2

Vector: CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C

Severity: High

CVSS v3

Base Score: 7.8

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Severity: High

EPSS

EPSS: 0.99969