Skip to content
OpenAdvisories
High · 7.8 Known exploited Public exploit CVE-2021-3156 EUVD-2021-26500GHSA-w5vh-2923-gp5c

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…

Published Jan 26, 2021 · Updated Oct 21, 2025 · Assigned by mitre

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 sudo 1.9.5p1-1.1 —
Debian 13 sudo 1.9.5p1-1.1 —
Debian 12 sudo 1.9.5p1-1.1 —
Debian 10 sudo 1.8.27-1+deb10u3 DSA-4839-1
Debian 9 sudo 1.8.19p1-2.1+deb9u3 DLA-2534-1
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS sudo 1.8.31-1ubuntu1.2 USN-4705-1
Ubuntu 18.04 LTS sudo 1.8.21p2-3ubuntu1.4 USN-4705-1
Ubuntu 16.04 LTS sudo 1.8.16-0ubuntu1.10 USN-4705-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 14.04 LTS sudo 1.8.9p5-1ubuntu1.5+esm6 USN-4705-2
ReleasePackageFixed inAdvisory
RHEL 8 sudo 1.8.29-6.el8_3.1 RHSA-2021:0218
RHEL 7 redhat-virtualization-host +1 4.3.13-20210127.0.el7_9 RHSA-2021:0395
RHEL 7 sudo +1 1.8.23-10.el7_9.1 RHSA-2021:0221
Show 11 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat Rhev Hypervisor 4 redhat-virtualization-host +1 4.4.4-20210201.0.el8_3 RHSA-2021:0401
RHEL 8.2 EUS sudo 1.8.29-5.el8_2.1 RHSA-2021:0219
RHEL 8.1 EUS sudo 1.8.25p1-8.el8_1.2 RHSA-2021:0220
RHEL 7.7 EUS sudo +1 1.8.23-4.el7_7.3 RHSA-2021:0222
RHEL 7.6 EUS sudo +1 1.8.23-3.el7_6.2 RHSA-2021:0223
RHEL 7.4 TUS sudo +1 1.8.19p2-12.el7_4.2 RHSA-2021:0224
RHEL 7.4 E4S sudo +1 1.8.19p2-12.el7_4.2 RHSA-2021:0224
RHEL 7.4 AUS sudo +1 1.8.19p2-12.el7_4.2 RHSA-2021:0224
RHEL 7.3 AUS sudo +1 1.8.6p7-23.el7_3.3 RHSA-2021:0225
RHEL 7.2 AUS sudo +1 1.8.6p7-17.el7_2.3 RHSA-2021:0226
RHEL 6 ELS sudo +1 1.8.6p3-29.el6_10.4 RHSA-2021:0227
ReleasePackageFixed inAdvisory
SLES 15 SP2 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLES 15 SP1 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLES 15 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLES 12 SP5 sudo 1.8.27-4.6.1 SUSE-SU-2024:4389-1, SUSE-SU-2021:1274-1, SUSE-SU-2021:0225-1
SLES 12 SP4 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
Show 22 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP3 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SLES 12 SP2 sudo 1.8.10p3-10.29.1 SUSE-SU-2021:1267-1, SUSE-SU-2021:0928-1, SUSE-SU-2021:0232-1
SLES for SAP 15 SP1 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLES for SAP 15 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLES for SAP 12 SP5 sudo 1.8.27-4.6.1 SUSE-SU-2021:1274-1, SUSE-SU-2021:0225-1
SLES for SAP 12 SP4 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SLES for SAP 12 SP3 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SLES for SAP 12 SP2 sudo 1.8.10p3-10.29.1 SUSE-SU-2021:0928-1, SUSE-SU-2021:0232-1
SLE Micro 5.0 sudo 1.8.22-4.18.1 SUSE-SU-2021:1275-1
SLE HPC 15 SP1 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SLE HPC 15 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SUSE OpenStack Cloud Crowbar 9 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SUSE OpenStack Cloud Crowbar 8 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SUSE OpenStack Cloud 9 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SUSE OpenStack Cloud 8 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SUSE OpenStack Cloud 7 sudo 1.8.10p3-10.29.1 SUSE-SU-2021:0928-1, SUSE-SU-2021:0232-1
SUSE Manager Server 4.0 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SUSE Manager Retail Branch Server 4.0 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SUSE Manager Proxy 4.0 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SUSE HPE Helion OpenStack 8 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:1273-1, SUSE-SU-2021:0226-1
SUSE Enterprise Storage 6 sudo 1.8.22-4.15.1 SUSE-SU-2021:1275-1, SUSE-SU-2021:0227-1
SUSE Enterprise Storage 5 sudo 1.8.20p2-3.20.1 SUSE-SU-2021:0226-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed sudo 1.9.7p2-1.4 openSUSE-SU-2024:11413-1
openSUSE Leap 15.2 sudo 1.8.22-lp152.8.6.1 openSUSE-SU-2021:0602-1, openSUSE-SU-2021:0170-1
openSUSE Leap 15.1 sudo 1.8.22-lp151.5.12.1 openSUSE-SU-2021:0169-1
ReleasePackageFixed inAdvisory
Alpine v3.24 sudo 1.9.5_p2-r0 —
Alpine v3.23 sudo 1.9.5_p2-r0 —
Alpine v3.22 sudo 1.9.5_p2-r0 —
Alpine v3.21 sudo 1.9.5_p2-r0 —
Alpine v3.20 sudo 1.9.5_p2-r0 —
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 sudo 1.9.5_p2-r0 —
Alpine v3.18 sudo 1.9.5p2-r0 —
Alpine v3.17 sudo 1.9.5p2-r0 —
Alpine v3.16 sudo 1.9.5p2-r0 —
Alpine v3.15 sudo 1.9.5p2-r0 —
Alpine v3.14 sudo 1.9.5p2-r0 —
Alpine v3.13 sudo 1.9.5p2-r0 —
Alpine v3.12 sudo 1.9.5p2-r0 —
Alpine v3.11 sudo 1.8.31-r1 —
Alpine v3.10 sudo 1.9.5p2-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2 sudo +1 1.8.23-4.amzn2.2.1 ALAS2-2021-1590

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 8 sudo 1.8.29-6.el8_3.1 ELSA-2021-0218
Oracle Linux 7 sudo +1 1.8.23-10.el7_9.1 ELSA-2021-0221

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Metasploit 1 module

GitHub 90 repositories · most starred shown

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 41

References