CVE-2021-3156
Sudo Project Sudo 1.8.2 – 1.8.32
Raw vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HSummary
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
- 🇪🇺 ENISA EUVD: EUVD-2021-26500
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
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
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.
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.
Security testing in development and acceptance can detect off-by-one errors before release.
Secure development life cycle includes requirements and reviews that can catch off-by-one errors.
Application security requirements can specify bounds-checking and input validation to prevent off-by-one errors.
Secure system architecture and engineering principles promote defensive coding practices that reduce off-by-one mistakes.
Secure coding directly addresses off-by-one errors through coding standards and peer review.