SecurityContext

CVE-2021-3156: Sudo - Privilege Escalation

  • Cve: CVE-2021-3156
  • Name: Sudo - Privilege Escalation
  • 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.
  • Impact: Attackers can escalate privileges to root, potentially leading to full system compromise.
  • Remediation: Update to version 1.9.5p2 or later.
  • Vulnerability type: buffer_overflow
  • Vulnerability impact: privilege_escalation
  • Requirement type: logged_in
  • Requirements: Attacker needs local access and command execution capability
  • Labels source: projectdiscovery
  • Severity: high
  • Cvss score: 7.8
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.99962
  • Epss percentile: 0.99976
  • Assignee: [email protected]
  • Published at: 2021-01-26T21:15:12Z
  • Age in days: 2127
  • Modified at: 2026-06-17T04:04:45Z
  • Patch available: yes
  • Public exploits total: 100
  • Public exploits capped: yes
  • References total: 41
  • Products total: 24
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-3156
  • Nvd status: analyzed
  • Checked, none or zero: rejected by nvd

Cwe

IdName
CWE-193Off-by-one Error

Known exploited entries

ListAdded dateDue dateRansomware use
cisa2022-04-062022-04-27no
vulncheck2022-04-06—no

Nuclei templates

IdUrl
CVE-2021-3156https://github.com/projectdiscovery/nuclei-templates/blob/main/code/cves/2021/CVE-2021-3156.yaml

Hackerone

  • Reports: 4
  • Rank: 1320

Public exploits

Same in every row:

  • Source: nvd
  • Added date: 2021-01-26
Url
http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html
http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html
http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html
http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html
http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html

References

Same in every row:

  • Source: nvd
UrlTags
http://www.openwall.com/lists/oss-security/2021/09/14/2Mailing List, Patch, Third Party Advisory
https://www.oracle.com//security-alerts/cpujul2021.htmlPatch, Third Party Advisory
https://www.oracle.com/security-alerts/cpuapr2022.htmlPatch, Third Party Advisory
https://www.oracle.com/security-alerts/cpuoct2021.htmlPatch, Third Party Advisory
http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.htmlExploit, Third Party Advisory, VDB Entry
http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.htmlExploit, Third Party Advisory, VDB Entry
http://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.htmlExploit, Third Party Advisory, VDB Entry
http://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.htmlExploit, Third Party Advisory, VDB Entry
http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.htmlExploit, Third Party Advisory, VDB Entry
http://seclists.org/fulldisclosure/2021/Jan/79Exploit, Mailing List, Third Party Advisory

Products

Same in every row:

  • Platform bound: no
  • Sources: nvd
ProductAffectedUrl
sudo_project:sudo= 1.9.5; = 1.9.5 patch1; >= 1.9.0, < 1.9.5; >= 1.8.2, < 1.8.32/v1/products/sudo_project/sudo
debian:debian_linux= 10.0, = 9.0/v1/products/debian/debian_linux
fedoraproject:fedora= 33, = 32/v1/products/fedoraproject/fedora
netapp:active_iq_unified_managerall versions/v1/products/netapp/active_iq_unified_manager
netapp:cloud_backupall versions/v1/products/netapp/cloud_backup
netapp:solidfireall versions/v1/products/netapp/solidfire
netapp:ontap_select_deploy_administration_utilityall versions/v1/products/netapp/ontap_select_deploy_administration_utility
netapp:hci_management_nodeall versions/v1/products/netapp/hci_management_node
synology:diskstation_manager= 6.2/v1/products/synology/diskstation_manager
mcafee:web_gateway= 10.0.4, = 9.2.8, = 8.2.17/v1/products/mcafee/web_gateway

Projects

RepositoryLink kindsIndexedUrl
sudo-project/sudofixyes/v1/repositories/sudo-project/sudo

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Known exploited: yes
  • Known exploited since: 2022-04-06
  • Known exploited by: cisa, vulncheck
  • Vulncheck known exploited since: 2022-04-06
  • Exploitation seen: yes
  • Public exploit: yes
  • Public exploit count: 100
  • Public exploit first date: 2021-01-26
  • Authentication required: yes
  • Hackerone reports: 4
  • Exposed hosts: 4706702
  • Checked, none or zero: initial access, remote
  • Not known: initial access since

Nuclei template