cbcvebase.
CVE-2021-3156
published 2021-01-26

CVE-2021-3156: 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"…

PriorityP189high7.8CVSS 3.1
AVLACLPRLUINSUCHIHAH
KEVITWEXPLOIT
CISA Known Exploited Vulnerabilitydue 2022-04-27
Exploited in the wild
EPSS
99.30%
99.9th percentile
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.

Affected

35 ranges· showing 25
VendorProductVersion rangeFixed in
beyondtrustprivilege_management_for_mac< 21.1.121.1.1
beyondtrustprivilege_management_for_unix_linux< 10.3.2-1010.3.2-10
debiandebian_linux
debiandebian_linux
debiansudo< sudo 1.9.5p1-1.1 (bookworm)sudo 1.9.5p1-1.1 (bookworm)
fedoraprojectfedora
fedoraprojectfedora
mcafeeweb_gateway
mcafeeweb_gateway
mcafeeweb_gateway
netappontap_tools
oraclecommunications_performance_intelligence_center10.3.0.0.0 – 10.3.0.2.1
oraclecommunications_performance_intelligence_center10.4.0.1.0 – 10.4.0.3.1
oraclemicros_compact_workstation_3_firmware
oraclemicros_es400_firmware400 – 410
oraclemicros_kitchen_display_system_firmware
oraclemicros_workstation_5a_firmware
oraclemicros_workstation_6_firmware610 – 655
oracletekelec_platform_distribution7.4.0 – 7.7.1
paloaltopan-os
paloaltoprisma_cloud_compute
paloaltoprisma_sd-wan
sudo_projectsudo
sudo_projectsudo>= 0 < 1.9.5p1-1.11.9.5p1-1.1
sudo_projectsudo>= 0 < 1.9.5p1-1.11.9.5p1-1.1

Detection & IOCsextracted from sources · hover to see the quote

commandsudoedit -s '\' `perl -e 'print "A" x 65536'`
commandenv -i 'AA=a\' 'B=b\' 'C=c\' 'D=d\' 'E=e\' 'F=f' sudoedit -s '1234567890123456789012\'
  • Monitor for unexpected writes or modifications to /usr/bin/.dbus.log, which is used by the AuthDoor PAM backdoor (deployed alongside CVE-2021-3156 exploitation) to store captured credentials in ASCII hex format.
  • Alert on replacement or unexpected modification of pam_unix.so or pam_unix2.so, as threat actors exploiting CVE-2021-3156 for privilege escalation were observed overwriting these PAM libraries with a backdoored version (AuthDoor).
  • Monitor for files being created or executed under /var/spool/.network/, a directory used by the AuthDoor PAM backdoor for staging and executing additional payloads.
  • Detect GTPDoor C2 activity by monitoring for unexpected UDP traffic on port 2123 (GTP-C), which the implant uses to tunnel command-and-control traffic after gaining access via CVE-2021-3156.
  • ·The vulnerability is exploitable in the default sudo configuration; no special sudoers policy or privileges are required for a non-root user to trigger the heap overflow.

CVSS provenance

nvdv3.17.8HIGHCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.2HIGHAV:L/AC:L/Au:N/C:C/I:C/A:C
osv7.8HIGH
vulncheck7.8HIGH
cisa7.8HIGH
vendor_debian7.8HIGH
vendor_oracle7.8HIGH
vendor_redhat7.8HIGH
vendor_ubuntu7.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.