Free and open · new CVEs checked every 20 minutesStatusRSSOpen dataContact

CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability

87
Patch now
HIGH 7.8EXPLOITEDWATCHLISTUPGRADEMITIGATEMITIGATE

CVE-2021-3156 is a high-severity flaw (CVSS 7.8) affecting sudo, fedora, debian linux, reported as exploited in the wild. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.

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.

Why this priority

  • High severity
  • EPSS top 1%: very likely to be exploited
  • Exploited in the wild (CISA KEV)
  • Public exploit reference
  • On your watchlist

A fixed release or distro patch exists.

Risk facts

CVSS score7.8 (High)
Attack vectorLocal
Attack complexityLow
Privileges neededLow
User interactionNone
EPSS exploit chance100.0% (top 1%)
CISA exploited listYes, fix due 2022-04-27
WeaknessCWE-193
Published2021-01-26
Last modified2026-06-17
Publisher (CNA): MITRE · Vendor: debian · fedoraproject · netapp · sudo project

Share: LinkedIn · X · Reddit

Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score

Am I affected?

Timeline

sudo project sudo UPGRADE
Affected: >= 1.8.2 and < 1.8.32 · >= 1.9.0 and < 1.9.5 · 1.9.5 · 1.9.5 patch1
Fixed in: 1.8.32, 1.9.5
Safe to downgrade to: no unaffected older release
1. Check installed version
apt-cache policy sudo || rpm -q sudo || sudo --version
2. UPGRADE to 1.8.32 (Debian / Ubuntu)
sudo apt update && sudo apt install --only-upgrade sudo
2. UPGRADE (RHEL / Amazon Linux / Fedora)
sudo dnf upgrade sudo
Note
Distros often backport fixes without changing the version number. Confirm with the distro advisory or changelog.
fedoraproject fedora MITIGATE
Affected: 32 · 33
Fixed in: no fixed release known
Safe to downgrade to: a release before 32
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
debian debian linux MITIGATE
Affected: 9.0 · 10.0
Fixed in: no fixed release known
Safe to downgrade to: a release before 9.0
Check your OS release
cat /etc/os-release; uname -r
Debian / Ubuntu
sudo apt update && sudo apt full-upgrade
RHEL / Amazon Linux / Fedora
sudo dnf upgrade --refresh
Windows
Install the latest cumulative update from Windows Update
If no patch exists yet
OS downgrades are not safe. Apply the vendor mitigation from the advisory and restrict exposure.
netapp active iq unified manager MITIGATE
Affected: all versions
Fixed in: no fixed release known
Safe to downgrade to: no unaffected older release
1. Check installed version
apt-cache policy active-iq-unified-manager || rpm -q active-iq-unified-manager || active-iq-unified-manager --version
No fixed or unaffected release known
Apply the vendor mitigation from the advisory, disable the affected feature, or restrict network access.
netapp cloud backup MITIGATE
Affected: all versions
Fixed in: no fixed release known
Safe to downgrade to: no unaffected older release
1. Check installed version
apt-cache policy cloud-backup || rpm -q cloud-backup || cloud-backup --version
No fixed or unaffected release known
Apply the vendor mitigation from the advisory, disable the affected feature, or restrict network access.
netapp hci management node MITIGATE
Affected: all versions
Fixed in: no fixed release known
Safe to downgrade to: no unaffected older release
1. Check installed version
apt-cache policy hci-management-node || rpm -q hci-management-node || hci-management-node --version
No fixed or unaffected release known
Apply the vendor mitigation from the advisory, disable the affected feature, or restrict network access.

Exact fixes by distribution

A distro patch exists: prefer upgrading over downgrading.
Fedora 46 · feh · FIXED · 3.13.1-1.fc46 · FEDORA-2026-3c76a13a4f · source
sudo dnf upgrade --advisory=FEDORA-2026-3c76a13a4f
Fedora ELN · setroubleshoot · FIXED · 3.3.37-7.eln159 · FEDORA-2026-f81b122fe1 · source
sudo dnf upgrade --advisory=FEDORA-2026-f81b122fe1
Ubuntu 20.04 · sudo · FIXED · 1.8.31-1ubuntu1.2
sudo apt update && sudo apt install --only-upgrade sudo dpkg --compare-versions "$(dpkg-query -W -f='${Version}' sudo)" ge "1.8.31-1ubuntu1.2" && echo PATCHED || echo STILL-VULNERABLE
Debian 12 · sudo · FIXED · 1.9.5p1-1.1
sudo apt update && sudo apt install --only-upgrade sudo dpkg --compare-versions "$(dpkg-query -W -f='${Version}' sudo)" ge "1.9.5p1-1.1" && echo PATCHED || echo STILL-VULNERABLE
Debian 13 · sudo · FIXED · 1.9.5p1-1.1
sudo apt update && sudo apt install --only-upgrade sudo dpkg --compare-versions "$(dpkg-query -W -f='${Version}' sudo)" ge "1.9.5p1-1.1" && echo PATCHED || echo STILL-VULNERABLE
RHEL 6 Extended Lifecycle Support · sudo · FIXED · sudo-1.8.6p3-29.el6_10.4
sudo dnf upgrade --advisory=RHSA-2021:0227 rpm -q sudo
RHEL 7 · sudo · FIXED · sudo-1.8.23-10.el7_9.1
sudo dnf upgrade --advisory=RHSA-2021:0221 rpm -q sudo
RHEL 7.2 Advanced Update Support · sudo · FIXED · sudo-1.8.6p7-17.el7_2.3
sudo dnf upgrade --advisory=RHSA-2021:0226 rpm -q sudo
RHEL 7.3 Advanced Update Support · sudo · FIXED · sudo-1.8.6p7-23.el7_3.3
sudo dnf upgrade --advisory=RHSA-2021:0225 rpm -q sudo
RHEL 7.4 Advanced Update Support · sudo · FIXED · sudo-1.8.19p2-12.el7_4.2
sudo dnf upgrade --advisory=RHSA-2021:0224 rpm -q sudo
Alpine 3.20 · sudo · FIXED · sudo-1.9.5_p2-r0
apk add --upgrade sudo apk info -v sudo
Alpine 3.21 · sudo · FIXED · sudo-1.9.5_p2-r0
apk add --upgrade sudo apk info -v sudo
Alpine 3.22 · sudo · FIXED · sudo-1.9.5_p2-r0
apk add --upgrade sudo apk info -v sudo
Alpine 3.23 · sudo · FIXED · sudo-1.9.5_p2-r0
apk add --upgrade sudo apk info -v sudo
Amazon Linux 2 · see advisory · FIXED · ALAS2-2021-1590 · source
sudo yum update --advisory=ALAS2-2021-1590
Amazon Linux 1 · see advisory · FIXED · ALAS-2021-1478 · source
sudo yum update --advisory=ALAS-2021-1478

Public exploits and detection

Public code exists for this CVE. Treat unpatched systems as at risk, and only run PoCs in a lab.

Verify at the official source NVD · CVE Program · CISA KEV catalog · Report a problem with this page
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.

Quick answers

How do I fix CVE-2021-3156?

sudo: upgrade to 1.8.32, 1.9.5; fedora: mitigate or apply the listed mitigation; debian linux: mitigate or apply the listed mitigation. Exact commands for each OS are on this page.

Is CVE-2021-3156 being exploited?

Yes. CVE-2021-3156 is on the CISA Known Exploited Vulnerabilities list, so treat it as patch-now.

What does CVE-2021-3156 affect?

CVE-2021-3156 affects sudo, fedora, debian linux. Severity is high (CVSS 7.8). 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.

How urgent is CVE-2021-3156?

Priority 87/100. High severity; EPSS top 1%: very likely to be exploited; Exploited in the wild (CISA KEV); Public exploit reference; On your watchlist

Software pages

Debian vulnerabilities · Sudo vulnerabilities

Related CVEs

References

← Back to latest CVEs

Get the weekly exploited-CVE digest by emailThe CVEs being attacked this week and how to fix them. No spam, unsubscribe any time.