CVEfocus › CVE database › CVE-2021-3156

CVE-2021-3156

Known exploited (CISA KEV)CVSS 7.8 HighEPSS 99.9% (in the top 1% of all CVEs)Published 2021-01-26Updated 2025-10-21Assigner: mitre

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.

CWE-193

What to do

This CVE is being exploited in the wild (CISA Known Exploited Vulnerabilities, added 2022-04-06). If you run an affected version, patch or mitigate now.

Fixed builds are available from Alpine, Debian, Red Hat, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

26Fixed
1Fix pending
3Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 20.04sudoFixed1.8.31-1ubuntu1.2UBUNTU-CVE-2021-3156
Ubuntu 18.04sudoFixed1.8.21p2-3ubuntu1.4UBUNTU-CVE-2021-3156
Ubuntu 16.04sudoFixed1.8.16-0ubuntu1.10UBUNTU-CVE-2021-3156
Ubuntu 14.04sudoFix pending1.8.9p5-1ubuntu1.5+esm6 (Ubuntu Pro)UBUNTU-CVE-2021-3156
Debian 14sudoFixed1.9.5p1-1.1DEBIAN-CVE-2021-3156
Debian 13sudoFixed1.9.5p1-1.1DEBIAN-CVE-2021-3156
Debian 12sudoFixed1.9.5p1-1.1DEBIAN-CVE-2021-3156
Red Hat Enterprise Linux 9sudoNot affected
Red Hat Enterprise Linux 9sudo-python-pluginNot affected
Red Hat Enterprise Linux 8sudoFixed0:1.8.29-6.el8_3.1RHSA-2021:0218
Red Hat Enterprise Linux 7redhat-virtualization-hostFixed0:4.3.13-20210127.0.el7_9RHSA-2021:0395
Red Hat Enterprise Linux 7redhat-virtualization-host-image-updateFixed0:4.3.13-20210127.0.el7_9RHSA-2021:0395
Red Hat Enterprise Linux 7sudoFixed0:1.8.23-10.el7_9.1RHSA-2021:0221
Red Hat Enterprise Linux 7sudo-develFixed0:1.8.23-10.el7_9.1RHSA-2021:0221
Red Hat Enterprise Linux 5sudoNot affected
Alpine Linux 3.24sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.23sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.22sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.21sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.20sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.19sudoFixed1.9.5_p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.18sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.17sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.16sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.15sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.14sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.13sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.12sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156
Alpine Linux 3.11sudoFixed1.8.31-r1ALPINE-CVE-2021-3156
Alpine Linux 3.10sudoFixed1.9.5p2-r0ALPINE-CVE-2021-3156

What the vendor says

As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.