CVE-2021-3156highunder attackCWE-193

CVE-2021-3156

Published · Updated

E-mail alert when it lands in KEV, gets a public PoC or its score goes up.

100Vexday Risk Score

Patch now. It under exploitation confirmed by CISA and has a working public exploit.

ssvc Actcvss 7.8epss 100%
from disclosure to weaponsame day
Published on NVDJan 26
1st PoCJan 26
metasploitJan 26
CISA KEV+435d
What the vendors declare (VEX)

Official vendor statements in CSAF/VEX format: whether their product is affected, already fixed, or ruled out — and why. These are the vendor's assertions, not Vexday's judgment.

Fixed
35 products (211 components)
Red Hat Enterprise Linux Server Optional (v. 7) · Red Hat Enterprise Linux Server Optional EUS (v. 7.6) · Red Hat Enterprise Linux Server Optional EUS (v. 7.7) · Red Hat Enterprise Linux BaseOS (v. 8) · Red Hat Enterprise Linux BaseOS EUS (v. 8.1) · and others 30
Not affected
6 products (106 components) — because the vulnerable code is not present in the product
Red Hat Virtualization 4 Hypervisor for RHEL 8 · Red Hat Virtualization 4 Management Agent for RHEL 7 Hosts · RHEL 8-based RHEV-H for RHEV 4 (build requirements) · RHEL 7-based RHEV-H for RHEV 4 (build requirements) · Red Hat Enterprise Linux 9 · and others 1
Action required by CISAfederal deadline: 2022-04-27

Apply updates per vendor instructions.

In short

Sudo has a flaw where a specially crafted command ending with a backslash can overflow memory and let an attacker gain root access. This affects older versions of Sudo and can be exploited through the sudoedit command.

Technical detail

An off-by-one error in Sudo versions before 1.9.5p2 leads to heap-based buffer overflow when processing sudoedit with the -s flag followed by arguments terminating in a backslash. This allows local privilege escalation to root; requires sudoedit functionality to be available to the user.

Summary generated and translated by AI from the official description.

The full analysis of this CVE is available in Portuguese →

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.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected products
n/a · n/a
public PoCs found — 182
exploitdbwww.exploit-db.com/exploits/49522unverifiedexploitdbwww.exploit-db.com/exploits/49521unverifiedgithubgithub.com/blasty/CVE-2021-3156★ 1032githubgithub.com/worawit/CVE-2021-3156★ 812githubgithub.com/stong/CVE-2021-3156★ 429githubgithub.com/LiveOverflow/pwnedit★ 226githubgithub.com/Rvn0xsy/CVE-2021-3156-plus★ 204githubgithub.com/CptGibbon/CVE-2021-3156★ 158githubgithub.com/reverse-ex/CVE-2021-3156★ 112githubgithub.com/0x4ndy/clif★ 100githubgithub.com/0xdevil/CVE-2021-3156★ 51githubgithub.com/mbcrump/CVE-2021-3156★ 38githubgithub.com/mr-r3b00t/CVE-2021-3156★ 35githubgithub.com/PhuketIsland/CVE-2021-3156-centos7★ 30githubgithub.com/kernelzeroday/CVE-2021-3156-Baron-Samedit★ 18githubgithub.com/redhawkeye/sudo-exploit★ 17githubgithub.com/jm33-m0/CVE-2021-3156★ 16githubgithub.com/chenaotian/CVE-2021-3156★ 10githubgithub.com/Maalfer/Sudo-CVE-2021-3156★ 8githubgithub.com/teamtopkarl/CVE-2021-3156★ 7githubgithub.com/apogiatzis/docker-CVE-2021-3156★ 7githubgithub.com/1N53C/CVE-2021-3156-PoC★ 7githubgithub.com/PurpleOzone/PE_CVE-CVE-2021-3156★ 7githubgithub.com/Mhackiori/CVE-2021-3156★ 5githubgithub.com/yaunsky/cve-2021-3156★ 5githubgithub.com/dinhbaouit/CVE-2021-3156★ 5githubgithub.com/baka9moe/CVE-2021-3156-Exp★ 4githubgithub.com/lmol/CVE-2021-3156★ 4githubgithub.com/kal1gh0st/CVE-2021-3156★ 3githubgithub.com/elbee-cyber/CVE-2021-3156-PATCHER★ 3githubgithub.com/ph4ntonn/CVE-2021-3156★ 3githubgithub.com/lypd0/CVE-2021-3156-checker★ 2githubgithub.com/musergi/CVE-2021-3156★ 2githubgithub.com/Q4n/CVE-2021-3156★ 2githubgithub.com/TheLeopard65/CVE-2021-3156-Baron-Samedit★ 2githubgithub.com/ypl6/heaplens★ 2githubgithub.com/unauth401/CVE-2021-3156★ 1githubgithub.com/BearCat4/CVE-2021-3156★ 1githubgithub.com/puckiestyle/CVE-2021-3156★ 1githubgithub.com/0x7183/CVE-2021-3156★ 1githubgithub.com/DASICS-ICT/DASICS-CVE-2021-3156★ 1githubgithub.com/nobodyatall648/CVE-2021-3156★ 1githubgithub.com/wangqian06/CVE-2021-3156★ 1githubgithub.com/Shuhaib88/Baron-Samedit-Heap-Buffer-Overflow-CVE-2021-3156★ 1githubgithub.com/binw2018/CVE-2021-3156-SCRIPT★ 1githubgithub.com/d4ytox/CVE-2021-3156★ 1githubgithub.com/SantiagoSerrao/ScannerCVE-2021-3156★ 1githubgithub.com/RodricBr/CVE-2021-3156★ 1githubgithub.com/TheFlash2k/CVE-2021-3156★ 1githubgithub.com/juju306/CVE-2021-3156★ 1githubgithub.com/q77190858/CVE-2021-3156★ 1githubgithub.com/donghyunlee00/CVE-2021-3156★ 1githubgithub.com/Bad3r/CVE-2021-3156-without-ip-command★ 0githubgithub.com/ymrsmns/CVE-2021-3156★ 0githubgithub.com/freeFV/CVE-2021-3156★ 0githubgithub.com/cdeletre/Serpentiel-CVE-2021-3156★ 0githubgithub.com/perlun/sudo-1.8.3p1-patched★ 0githubgithub.com/gmldbd94/cve-2021-3156★ 0githubgithub.com/ret2basic/SudoScience★ 0githubgithub.com/barebackbandit/CVE-2021-3156★ 0githubgithub.com/Sebastianbedoya25/CVE-2021-3156★ 0githubgithub.com/arvindshima/CVE-2021-3156★ 0githubgithub.com/mutur4/CVE-2021-3156★ 0githubgithub.com/ngtuonghung/CVE-2021-3156★ 0githubgithub.com/Superliverbun/cve-2021-3156-★ 0githubgithub.com/Sornphut/CVE-2021-3156-Heap-Based-Buffer-Overflow-in-Sudo-Baron-Samedit-★ 0githubgithub.com/Robblackcatchai/porfolio-Baron-Samedit★ 0githubgithub.com/IJBaig/CVE-2021-3156★ 0githubgithub.com/Shams-Ul-Mehmood/CVE-2021-3156-Project★ 0githubgithub.com/gmh5225/cve-2021-3156-★ 0githubgithub.com/Rana-Ali93/CVE-2021-3156-Sudo-Buffer-Overflow-Linux★ 0githubgithub.com/calonnuotcabe/CVE-2021-3156★ 0githubgithub.com/WhatsWrongAndWhy/CVE-2021-3156★ 0githubgithub.com/TopskiyPavelQwertyGang/Review.CVE-2021-3156★ 0githubgithub.com/DakerQirszh/cve-2021-3156★ 0githubgithub.com/HuzaifaTariqAfzalKhan/CVE-Exploit-Research-Development-ITSOLERA★ 0githubgithub.com/nexcess/sudo_cve-2021-3156★ 0githubgithub.com/Ashish-dawani/CVE-2021-3156-Patch★ 0githubgithub.com/DanielAzulayy/CTF-2021★ 0githubgithub.com/sandesh9978/CVE-2021-3156-Sudo-Checker★ 0githubgithub.com/capturingcats/CVE-2021-3156★ 0githubgithub.com/Exodusro/CVE-2021-3156★ 0githubgithub.com/sbladiamond/CVE-2021-3156★ 0githubgithub.com/asepsaepdin/CVE-2021-3156★ 0githubgithub.com/DDayLuong/CVE-2021-3156★ 0githubgithub.com/acidburn2049/CVE-2021-3156★ 0githubgithub.com/czeti/baron-samedit★ 0githubgithub.com/Kranti08/CVE-2021-3156-Baron-Samedit★ 0githubgithub.com/oneoy/CVE-2021-3156★ 0githubgithub.com/ajtech-hue/CVE-2021-3156-Mitigation-ShellScript-Build★ 0githubgithub.com/d3c3ptic0n/CVE-2021-3156★ 0githubgithub.com/halissha/CVE-2021-3156★ 0githubgithub.com/sharkmoos/Baron-Samedit★ 0githubgithub.com/hycheng15/CVE-2021-3156★ 0githubgithub.com/wurwur/CVE-2021-3156★ 0githubgithub.com/shishirpandey18/CVE-2021-3156★ 0githubgithub.com/ConstantineFedorov/Review.CVE-2021-3156★ 0githubgithub.com/VilmarTuminskii/cve-2021-3156-sudo-lab★ 0githubgithub.com/AmroYasserH/DFIR-CVE-2021-3156-Incident-Response★ 0vulncheckvulncheck.com/xdb/de59d87d7443unverifiedvulncheckvulncheck.com/xdb/cb038c4634e2unverifiedvulncheckvulncheck.com/xdb/a36a6349c87bunverifiedvulncheckvulncheck.com/xdb/a7e527112fb0unverifiedvulncheckvulncheck.com/xdb/c5972ce378fcunverifiedvulncheckvulncheck.com/xdb/94ac175265dbunverifiedvulncheckvulncheck.com/xdb/c7646cc24cf1unverifiedvulncheckvulncheck.com/xdb/20f15e46bf13unverifiedvulncheckvulncheck.com/xdb/5fa314f8b37funverifiedvulncheckvulncheck.com/xdb/bfb260e80a93unverifiedvulncheckvulncheck.com/xdb/c1fae139d5d4unverifiedvulncheckvulncheck.com/xdb/e970e6dec7b1unverifiedvulncheckvulncheck.com/xdb/a3fcd264aa62unverifiedvulncheckvulncheck.com/xdb/172fcbe73544unverifiedvulncheckvulncheck.com/xdb/750ce3551defunverifiedvulncheckvulncheck.com/xdb/a2e62b6d17d1unverifiedvulncheckvulncheck.com/xdb/f3a81abb3ba0unverifiedvulncheckvulncheck.com/xdb/42c8e43d9038unverifiedvulncheckvulncheck.com/xdb/45a30e5e36feunverifiedvulncheckvulncheck.com/xdb/85981dac158cunverifiedvulncheckvulncheck.com/xdb/64d475da2992unverifiedvulncheckvulncheck.com/xdb/e559a5756f19unverifiedvulncheckvulncheck.com/xdb/574e35cbc6bcunverifiedvulncheckvulncheck.com/xdb/5fb557d581faunverifiedvulncheckvulncheck.com/xdb/ac997bc9135dunverifiedvulncheckvulncheck.com/xdb/c07ba8b1fa83unverifiedvulncheckvulncheck.com/xdb/07e3d18545fbunverifiedvulncheckvulncheck.com/xdb/3397f09dbbdcunverifiedvulncheckvulncheck.com/xdb/9fbcde6203e1unverifiedvulncheckvulncheck.com/xdb/d92fe7f1eb28unverifiedvulncheckvulncheck.com/xdb/8486488deafeunverifiedvulncheckvulncheck.com/xdb/36562f643e64unverifiedcve_referencepacketstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.htmlunverifiedcve_referencepacketstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.htmlunverifiedvulncheckvulncheck.com/xdb/33b2727e22e2unverifiedvulncheckvulncheck.com/xdb/956619acb26bunverifiedvulncheckvulncheck.com/xdb/1e5a3258d388unverifiedvulncheckvulncheck.com/xdb/8e3574a80584unverifiedvulncheckvulncheck.com/xdb/6f40fc0eb6b6unverifiedvulncheckvulncheck.com/xdb/d818ae56992aunverifiedvulncheckvulncheck.com/xdb/f074c511a33bunverifiedvulncheckvulncheck.com/xdb/25def691895eunverifiedvulncheckvulncheck.com/xdb/300797d10318unverifiedvulncheckvulncheck.com/xdb/be980714295cunverifiedvulncheckvulncheck.com/xdb/853bd97ca84dunverifiedvulncheckvulncheck.com/xdb/1db9ceee140bunverifiedcve_referencepacketstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.htmlunverifiedcve_referencepacketstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.htmlunverifiedvulncheckvulncheck.com/xdb/4e6ad9fd3fb3unverifiedvulncheckvulncheck.com/xdb/dd12494d2728unverifiedcve_referencepacketstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.htmlunverifiedvulncheckvulncheck.com/xdb/dc67aa8e60d4unverifiedvulncheckvulncheck.com/xdb/8a16e063dbd5unverifiedvulncheckvulncheck.com/xdb/ff18a04b19fbunverifiedvulncheckvulncheck.com/xdb/b2ee85cf4e76unverifiedvulncheckvulncheck.com/xdb/b72767d3ef0bunverifiedvulncheckvulncheck.com/xdb/3ee223200973unverifiedvulncheckvulncheck.com/xdb/81c88fb24bd9unverifiedvulncheckvulncheck.com/xdb/67522d547498unverifiedvulncheckvulncheck.com/xdb/e63e0be85a72unverifiedvulncheckvulncheck.com/xdb/6b4c5b3f6b0eunverifiedvulncheckvulncheck.com/xdb/314b3ed04db3unverifiedvulncheckvulncheck.com/xdb/73a26a137f38unverifiedvulncheckvulncheck.com/xdb/c60ebdc30c29unverifiedvulncheckvulncheck.com/xdb/0573a1989e58unverifiedvulncheckvulncheck.com/xdb/1add099f19fcunverifiedvulncheckvulncheck.com/xdb/6f8a62e9dc05unverifiedvulncheckvulncheck.com/xdb/f80704f9c087unverifiedvulncheckvulncheck.com/xdb/bdfb7b3c721cunverifiedvulncheckvulncheck.com/xdb/84e3dea90796unverifiedvulncheckvulncheck.com/xdb/12b9978dfd35unverifiedvulncheckvulncheck.com/xdb/4e52e6bd25cfunverifiedvulncheckvulncheck.com/xdb/791107725e9bunverifiedvulncheckvulncheck.com/xdb/d82fe374addcunverifiedvulncheckvulncheck.com/xdb/22cb903c9959unverifiedvulncheckvulncheck.com/xdb/5cd3a38f312aunverifiedvulncheckvulncheck.com/xdb/8f873fe619f2unverifiedvulncheckvulncheck.com/xdb/98bc51c674a1unverifiedvulncheckvulncheck.com/xdb/42c098e8e2ccunverifiedvulncheckvulncheck.com/xdb/748cab143d91unverifiedvulncheckvulncheck.com/xdb/664271a6cb02unverifiedvulncheckvulncheck.com/xdb/1ded723ada65unverifiedvulncheckvulncheck.com/xdb/b625d38ee231unverified
⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.