# CVE-2021-3156: Sudo Heap-Based Buffer Overflow Vulnerability

- Priority: **Act now**
- Reason: Listed as exploited by CISA (06-04-2022)
- Next step: Check the vendor advisory
- Status: published
- Published: 2021-01-26 · Modified: 2025-10-21
- Aliases: ALPINE-CVE-2021-3156, MGASA-2021-0056, SUSE-SU-2021:0928-1, SUSE-SU-2021:1267-1, SUSE-SU-2021:1273-1, SUSE-SU-2021:1274-1, SUSE-SU-2021:1275-1, SUSE-SU-2024:4389-1, RHSA-2021:0218, RHSA-2021:0219, RHSA-2021:0220, RHSA-2021:0221, RHSA-2021:0222, RHSA-2021:0223, RHSA-2021:0224, RHSA-2021:0225, RHSA-2021:0226, RHSA-2021:0227, UBUNTU-CVE-2021-3156, USN-4705-2, DEBIAN-CVE-2021-3156, DLA-2534-1, DSA-4839-1, openSUSE-SU-2021:0602-1
- Record: https://cvemate.com/vulnerability/CVE-2021-3156 · JSON: https://cvemate.com/vulnerability/CVE-2021-3156/json

## Description

```text
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.
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 99.962%, percentile 99.974%, as of 2026-12-04
- Known exploited (KEV): CISA listed 2022-04-06, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 15 (reference, exploit-database, metasploit)

## Affected (first 20 of 67)

- alpine sudo (Alpine Linux): ≥ 1.8.2, \< 1.9.5p2-r0 \| ≥ 1.8.2, \< 1.9.5\_p2-r0 \| ≥ 1.9.0, \< 1.9.5p2-r0 \| ≥ 1.8.2, \< 1.8.31-r1 \| ≥ 1.9.0, \< 1.9.5\_p2-r0
- beyondtrust privilege\_management\_for\_mac: \< 21.1.1
- beyondtrust privilege\_management\_for\_unix\\/linux: \< 10.3.2-10
- debian sudo (Debian): \< 1.9.5p1-1.1 \| \< 1.8.19p1-2.1+deb9u3 \| \< 1.8.27-1+deb10u3
- ubuntu sudo (Ubuntu): \< 1.8.9p5-1ubuntu1.5+esm6 \| \< 1.8.16-0ubuntu1.10 \| \< 1.8.21p2-3ubuntu1.4 \| \< 1.8.31-1ubuntu1.2
- debian debian\_linux: 9.0 \| 10.0
- fedoraproject fedora: 32 \| 33
- mageia sudo (Mageia): \< 1.9.5p2-1.mga7
- mcafee web\_gateway: 8.2.17 \| 9.2.8 \| 10.0.4
- netapp active\_iq\_unified\_manager: na
- netapp cloud\_backup: na
- netapp hci\_management\_node: na
- netapp oncommand\_unified\_manager\_core\_package: na
- netapp ontap\_select\_deploy\_administration\_utility: na
- netapp ontap\_tools: 9
- netapp solidfire: na
- oracle communications\_performance\_intelligence\_center: ≥ 10.3.0.0.0, ≤ 10.3.0.2.1 \| ≥ 10.4.0.1.0, ≤ 10.4.0.3.1
- oracle micros\_compact\_workstation\_3\_firmware: 310
- oracle micros\_es400\_firmware: ≥ 400, ≤ 410
- oracle micros\_kitchen\_display\_system\_firmware: 210

## References (first 20 of 82)

- <https://lists.debian.org/debian-lts-announce/2021/01/msg00022.html>
- <http://seclists.org/fulldisclosure/2021/Jan/79>
- <http://www.openwall.com/lists/oss-security/2021/01/26/3>
- <https://security.gentoo.org/glsa/202101-33>
- <https://www.debian.org/security/2021/dsa-4839>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/>
- <http://www.openwall.com/lists/oss-security/2021/01/27/1>
- <http://www.openwall.com/lists/oss-security/2021/01/27/2>
- <https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcM>
- <https://www.kb.cert.org/vuls/id/794544>
- <http://seclists.org/fulldisclosure/2021/Feb/42>
- <http://www.openwall.com/lists/oss-security/2021/02/15/1>
- <https://www.oracle.com//security-alerts/cpujul2021.html>
- <https://www.sudo.ws/stable.html#1.9.5p2>
- <https://www.openwall.com/lists/oss-security/2021/01/26/3>
- <http://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html>
- <https://security.netapp.com/advisory/ntap-20210128-0002/>
- <https://security.netapp.com/advisory/ntap-20210128-0001/>
- <http://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html>

---

Data as of 2026-12-05T02:36:16.381Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
