CVE-2021-3156
Sudo Heap-Based Buffer Overflow Vulnerability
- Published
- Jan 26, 2021
- Updated
- Oct 21, 2025
- Assigning CNA
- mitre
- Evidence observed
- Feb 3, 2021
Primary CVSS
nvd · CVSS 3.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HHigh · next 30 days
- Percentile
- 100.0%
- Model date
- Oct 17, 2026
EPSS is a statistical estimate, not a certainty or a measure of impact. Combine it with CVSS, KEV status, exposure and your environment.
CISA Known Exploited
This CVE appears in the CISA Known Exploited Vulnerabilities catalog.
Summary
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.
Sources
modules/exploits/linux/local/sudo_baron_samedit.rb
Metasploit Framework modulesDeclared conditions
- platform: Linux,Unix($.exploit_linux/local/sudo_baron_samedit.platform)
- verification: check_declared($.exploit_linux/local/sudo_baron_samedit.check)
- CVE-2021-3156Exploit
Sudo Heap Overflow Baron Samedit
- CVE-2021-3156-PoCExploit
Responsible use
Use vulnerability information only on systems you own or are authorized to test. Kitploit links to public research metadata and does not store exploit code or malicious payloads.