From 6ba3d6e53bdb006463e49c1ff97b2977a8e752a7 Mon Sep 17 00:00:00 2001 From: pussycat0x <65701233+pussycat0x@users.noreply.github.com> Date: Sat, 30 Dec 2023 20:35:49 +0530 Subject: [PATCH] Create CVE-2021-3156.yaml --- code/cves/2021/CVE-2021-3156.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 code/cves/2021/CVE-2021-3156.yaml diff --git a/code/cves/2021/CVE-2021-3156.yaml b/code/cves/2021/CVE-2021-3156.yaml new file mode 100644 index 0000000000..a388400bdd --- /dev/null +++ b/code/cves/2021/CVE-2021-3156.yaml @@ -0,0 +1,30 @@ +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 + metadata: + verified: true + tags: cve,cve2021,sudo,code,linux,privesc,local + +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