Cyber Resilience

CVE-2021-3156

Sudo Project Sudo 1.8.2 – 1.8.32

CISA KEVActive ExploitationEUVD ExploitedPublic PoC
Published
26 January 2021
Modified
10 November 2025
KEV Added
06 April 2022
Patch / advisory
CVSS Score v3.1 7.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.99 99.9th percentile
Risk Priority 83 floored blend · peak EPSS

Summary

CVE-2021-3156 is a high-severity Off-by-one Error (CWE-193) vulnerability in Sudo Project Sudo. Its CVSS base score is 7.8 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked in the top 0.1% of CVEs by exploit likelihood; CISA has added it to the Known Exploited Vulnerabilities catalog; a public proof-of-concept is referenced.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

Sudo before version 1.9.5p2 is affected by an off-by-one error that produces a heap-based buffer overflow, tracked as CVE-2021-3156 and assigned CWE-193. The flaw resides in the command-line argument handling path used by sudoedit when invoked with the -s flag.

Local attackers who are already permitted to run sudoedit can trigger the overflow by supplying a command-line argument that terminates with a single backslash character, resulting in full root privilege escalation on the host. The vulnerability carries a CVSS 3.1 base score of 7.8 under the vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

Public exploit code demonstrating the issue against multiple Sudo releases has been posted to Packet Storm, confirming that working proof-of-concept attacks exist for versions prior to the 1.9.5p2 fix.

EU & UK References

Vulnerability Data

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(s)
KEV Date Added
06 April 2022

Related Threats

MITRE ATT&CK Enterprise Techniques

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1212 Exploitation for Credential Access Credential Access
Adversaries may exploit software vulnerabilities in an attempt to collect credentials.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2019-0211Same product: Debian Debian Linuxboth on KEV
CVE-2024-1086Same product: Debian Debian Linuxboth on KEV
CVE-2023-28709Same product: Debian Debian Linux
CVE-2019-2215Same product: Debian Debian Linuxboth on KEV
CVE-2020-15999Same product: Debian Debian Linuxboth on KEV
CVE-2024-10442Same product: Synology Diskstation Manager
CVE-2023-4863Same product: Debian Debian Linuxboth on KEV
CVE-2023-4911Same product: Debian Debian Linuxboth on KEV
CVE-2022-0185Same product class: NAS / storage applianceboth on KEV
CVE-2021-22600Same product: Debian Debian Linuxboth on KEV

Affected Assets

sudo project
sudo
1.9.5 · 1.8.2 — 1.8.32 · 1.9.0 — 1.9.5
fedoraproject
fedora
32, 33
debian
debian linux
10.0, 9.0
netapp
active iq unified manager
all versions
netapp
cloud backup
all versions
netapp
hci management node
all versions
netapp
oncommand unified manager core package
all versions
netapp
ontap select deploy administration utility
all versions
netapp
ontap tools
9
netapp
solidfire
all versions
+14 more product configuration(s) — see NVD for full list

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V6.2.1

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly prevent off-by-one errors via reviews, static analysis, and testing.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing in development and acceptance can detect off-by-one errors before release.

prevents

Secure development life cycle includes requirements and reviews that can catch off-by-one errors.

prevents

Application security requirements can specify bounds-checking and input validation to prevent off-by-one errors.

prevents

Secure system architecture and engineering principles promote defensive coding practices that reduce off-by-one mistakes.

prevents

Secure coding directly addresses off-by-one errors through coding standards and peer review.

References