Root privilege escalation via sudoedit argument unescaping
Published Jan 26, 2021 · Updated Oct 21, 2025
Heap-based buffer overflow in sudo 1.8.2 through 1.8.31p2 and 1.9.0 through 1.9.5p1 allows local users to gain root privileges. The set_cmnd() path allocates user_args from escaped argument lengths, then unescapes a trailing backslash and copies bytes excluded from the allocation size. Any local user able to execute sudoedit can trigger the flaw under the default configuration without sudoers membership or a password.
Summary
What happened
Heap-based buffer overflow in sudo 1.8.2 through 1.8.31p2 and 1.9.0 through 1.9.5p1 allows local users to gain root privileges. The set_cmnd() path allocates user_args from escaped argument lengths, then unescapes a trailing backslash and copies bytes excluded from the allocation size. Any local user able to execute sudoedit can trigger the flaw under the default configuration without sudoers membership or a password.
The record
- CVE
- CVE-2021-3156
- Published
- Jan 26, 2021
- Updated
- Oct 21, 2025
- Vendor
- Unknown vendor
- Product
- Unknown product
- Classifications
- CWE-122, T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Jan 26, 2021CVE publishedPublication date reported by the CVE source.
- Oct 21, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
What conditions does exploitation require?
What is affected?
Affected products and versions are unavailable in this record.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- blasty CVE-2021-3156 exploitfunctional · unverified
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Reported exploitation
- CISA 2021 Top Routinely Exploited Vulnerabilities listingreported exploitation
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo