PT-2021-1695 · Sudo+9 · Sudo+9

CVE-2021-3156

·

Published

2020-04-28

·

Updated

2026-08-24

CVSS v3.1

7.8

High

VectorAV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Sudo versions 1.8.2 through 1.8.31p2 Sudo versions 1.9.0 through 1.9.5p1
Description A heap-based buffer overflow exists in the parse args() function. This issue is caused by an off-by-one error that occurs when using sudoedit -s with a command-line argument ending in a single backslash character. A local unprivileged user, including the nobody account, can exploit this flaw to bypass authentication and escalate privileges to root.
Recommendations Update Sudo to version 1.9.5p2 or later. As a temporary mitigation, restrict the use of the sudoedit -s command for unprivileged users.

Exploit

Fix

LPE

DoS

Heap Based Buffer Overflow

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALT-PU-2020-2707
ALT-PU-2020-2731
ALT-PU-2021-1164
ALT-PU-2021-1174
ALT-PU-2021-1184
BDU:2021-00364
CESA-2020_1804
CESA-2021_0218
CESA-2021_0221
CESA-2021_1723
CVE-2021-3156
DLA-2534-1
DSA-4839-1
ELSA-2021-0218
ELSA-2021-0221
ELSA-2021-9169
MGASA-2021-0056
OESA-2021-1002
OPENSUSE-SU-2021:0169-1
OPENSUSE-SU-2021:0170-1
OPENSUSE-SU-2021:0602-1
OPENSUSE-SU-2021_0169-1
OPENSUSE-SU-2021_0170-1
OPENSUSE-SU-2021_0602-1
OPENSUSE-SU-2024:11413-1
RHSA-2020_1804
RHSA-2021:0218
RHSA-2021:0219
RHSA-2021:0220
RHSA-2021:0221
RHSA-2021:0222
RHSA-2021:0223
RHSA-2021:0224
RHSA-2021:0225
RHSA-2021:0226
RHSA-2021:0227
RHSA-2021:0395
RHSA-2021:0401
RHSA-2021_0218
RHSA-2021_0221
RHSA-2021_0227
RHSA-2021_1723
SUSE-SU-2021:0225-1
SUSE-SU-2021:0226-1
SUSE-SU-2021:0227-1
SUSE-SU-2021:0232-1
SUSE-SU-2021:0928-1
SUSE-SU-2021:1267-1
SUSE-SU-2021:1273-1
SUSE-SU-2021:1274-1
SUSE-SU-2021:1275-1
SUSE-SU-2021_0928-1
SUSE-SU-2021_1267-1
SUSE-SU-2021_1273-1
SUSE-SU-2021_1274-1
SUSE-SU-2021_1275-1
SUSE-SU-2024:4389-1
SUSE-SU-2024_4389-1
USN-4705-1
USN-4705-2

Affected Products

Alt Linux
Centos
Huawei Vrp
Linuxmint
Apple Macos
Red Hat
Red Os
Sudo
Suse
Ubuntu