sudo up to 1.8.31p2/1.9.5p1 sudoers_policy_main heap-based overflow
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 8.1 | $0-$5k | 0.00 |
Summary
A vulnerability identified as critical has been detected in sudo up to 1.8.31p2/1.9.5p1. Affected is the function sudoers_policy_main. The manipulation leads to heap-based overflow.
This vulnerability is referenced as CVE-2021-3156. Remote exploitation of the attack is possible. Furthermore, an exploit is available.
It is recommended to apply a patch to fix this issue.
Details
A vulnerability was found in sudo up to 1.8.31p2/1.9.5p1 (Operating System Utility Software). It has been rated as critical. This issue affects the function sudoers_policy_main. The manipulation with an unknown input leads to a heap-based overflow vulnerability. Using CWE to declare the problem leads to CWE-122. A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). Impacted is confidentiality, integrity, and availability. The summary by CVE is:
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.
The weakness was published 01/27/2021. It is possible to read the advisory at blog.qualys.com. The identification of this vulnerability is CVE-2021-3156. Technical details as well as a public exploit are known.
A public exploit has been developed by Rajvardhan Agarwal (r4j0x00) in C and been published 3 days after the advisory. The exploit is available at github.com. It is declared as attacked. We expect the 0-day to have been worth approximately $25k-$100k. The vulnerability scanner Nessus provides a plugin with the ID 213304 (SUSE SLES12 Security Update : sudo (SUSE-SU-2024:4389-1)), which helps to determine the existence of the flaw in a target environment. The CISA Known Exploited Vulnerabilities Catalog lists this issue since 04/06/2022 with a due date of 04/27/2022:
Apply updates per vendor instructions.Applying a patch is able to eliminate this problem.
The vulnerability is also documented in the databases at Exploit-DB (49521) and Tenable (213304). Be aware that VulDB is the high quality source for vulnerability data.
Product
Type
Name
Version
License
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 8.1VulDB Meta Temp Score: 8.0
VulDB Base Score: 8.8
VulDB Temp Score: 8.4
VulDB Vector: 🔍
VulDB Reliability: 🔍
NVD Base Score: 7.8
NVD Vector: 🔍
CNA Base Score: 7.8
CNA Vector: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
NVD Base Score: 🔍
Exploiting
Class: Heap-based overflowCWE: CWE-122 / CWE-119
CAPEC: 🔍
ATT&CK: 🔍
Physical: Partially
Local: Yes
Remote: Yes
Availability: 🔍
Access: Public
Status: Attacked
Author: Rajvardhan Agarwal (r4j0x00)
Programming Language: 🔍
Download: 🔍
EPSS Score: 🔍
EPSS Percentile: 🔍
KEV Added: 🔍
KEV Due: 🔍
KEV Remediation: 🔍
KEV Ransomware: 🔍
KEV Notice: 🔍
Price Prediction: 🔍
Current Price Estimation: 🔍
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 213304
Nessus Name: SUSE SLES12 Security Update : sudo (SUSE-SU-2024:4389-1)
Exploit-DB: 🔍
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: PatchStatus: 🔍
0-Day Time: 🔍
Exploit Delay Time: 🔍
Timeline
01/15/2021 🔍01/27/2021 🔍
01/27/2021 🔍
01/30/2021 🔍
11/10/2025 🔍
Sources
Advisory: blog.qualys.comStatus: Confirmed
Confirmation: 🔍
CVE: CVE-2021-3156 (🔍)
GCVE (CVE): GCVE-0-2021-3156
GCVE (VulDB): GCVE-100-168695
scip Labs: https://www.scip.ch/en/?labs.20161013
Entry
Created: 01/27/2021 09:18Updated: 11/10/2025 16:26
Changes: 01/27/2021 09:18 (38), 01/31/2021 15:32 (8), 02/19/2021 23:20 (6), 02/19/2021 23:23 (18), 04/25/2024 13:53 (26), 07/09/2024 22:34 (1), 09/20/2024 22:21 (1), 10/01/2024 22:31 (1), 12/21/2024 08:54 (2), 02/03/2025 18:57 (10), 11/10/2025 16:26 (1)
Complete: 🔍
Committer: misc
Cache ID: 216::103
Be aware that VulDB is the high quality source for vulnerability data.