Security 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 100.0th percentile
Risk Priority 83 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

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 Exploit Public-Facing Application (T1190); ranked in the top 0.0% 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

Threat-Actor AttributionAI

Microsoft Corp. (Salesforce / Slack engineer recruitment claims)
2021 Top Routinely Exploited Vulnerabilities | CISA
AnonOps
2021 Top Routinely Exploited Vulnerabilities | CISA
CrowdStrike (McAfee / Symantec civil claims)
Russian Military Cyber Actors Target US and Global Critical Infrastructure | CISA
SentinelOne (Cylance / BlackBerry civil claims)
Russian Military Cyber Actors Target US and Global Critical Infrastructure | CISA
Ember Bear (G1003)
Russian Military Cyber Actors Target US and Global Critical Infrastructure | CISA

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

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.
T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-28709Shared CWE-193
CVE-2024-10442Shared CWE-193
CVE-2025-23150Shared CWE-193
CVE-2024-46852Shared CWE-193
CVE-2024-31585Shared CWE-193
CVE-2024-36957Shared CWE-193
CVE-2024-26766Shared CWE-193
CVE-2021-21224Shared T1068, T1189both on KEV
CVE-2019-0211Shared T1068, T1189both on KEV
CVE-2023-4762Shared T1068, T1189both 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)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

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

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

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

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

prevents

Training can teach developers about common off-by-one pitfalls (null terminators, loop boundary conditions, length calculations), reducing a minority of instances, but these are subtle implementation bugs that even trained developers write, so the effect is real but bounded.

prevents

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

prevents

A.8.30 carries secure design, coding and testing practices (8.25-8.29) into outsourced development via contractual requirements, so an off-by-one error in delivered code is reduced the way those practices reduce it; the owner graded the analogous CWE-134 pair at `partial` and declared `partial` as the ceiling for this clause on this verb.

References