Vulnerabilities

Vulnerability · CVE-2021-3156

Sudo Heap-Based Buffer Overflow Vulnerability

Published Jan 26, 2021 · catalog updated Jun 16, 2026 · Sudo Sudo

Patch now

CVE-2021-3156 is in the CISA known-exploited catalog, due Apr 27, 2022. Confirm Sudo Sudo against the vendor advisory and apply that fix. The CVSS score does not change the priority.

Severity
High7.8
Known exploitation
CISA KEV and VulnCheck KEV
EPSS
99.96%
Remediation
Remediation guidance
Affected products
cpe debian/debian linux · cpe fedoraproject/fedora · cpe mcafee/web gateway · cpe netapp/active iq unified manager · cpe sudo project/sudo · cpe synology/diskstation manager unified controller

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.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • cpe debian/debian linux10.0
  • cpe debian/debian linux9.0
  • cpe fedoraproject/fedora32
  • cpe fedoraproject/fedora33
  • cpe mcafee/web gateway8.2.17
  • cpe netapp/active iq unified managerversion unspecified
  • cpe sudo project/sudo1.9.5
  • cpe synology/diskstation manager unified controller3.0
  • cpe synology/skynas firmwareversion unspecified
  • vendor Sudo Sudoversion unspecified

How to fix CVE-2021-3156

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

CVE-2021-3156 is in the CISA known-exploited catalog, due Apr 27, 2022. Confirm Sudo Sudo against the vendor advisory and apply that fix. The CVSS score does not change the priority.

Which versions are affected?

Compare what you have installed with debian/debian linux 10.0; debian/debian linux 9.0; mcafee/web gateway 8.2.17; sudo project/sudo 1.9.5. Apply updates per vendor instructions.

What should an analyst verify?

CWE-122: Heap-based Buffer Overflow; CWE-193. EPSS 99.96%. The CISA KEV listing is the exploitation evidence. A public exploit reference is linked in Sources. That is not the same as confirmed exploitation. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

No public source repository is identified for this product.

Timeline

Detection, updates, and resolution for this record.

  1. Jan 26, 2021 · Catalog

    Detected

    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.

  2. Apr 6, 2022 · CISA KEV

    Known exploited

    Apply updates per vendor instructions.

  3. Apr 27, 2022 · CISA KEV

    Remediation due

    Apply updates per vendor instructions.

  4. Jun 16, 2026 · Catalog

    Updated

    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.

Sources

  • CISA KEVConfirmed exploitationCVE-2021-3156

    Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.

    cisa.gov
  • CVE.orgVulnerability recordCVE-2021-3156

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2021-3156

    30-day exploitation probability 100.0%

    first.org
  • Exploit DatabasePublic exploit reference49521

    Public archive entry. The exploit body is not stored here.

    exploit-db.com
  • Exploit DatabasePublic exploit reference49522

    Public archive entry. The exploit body is not stored here.

    exploit-db.com
  • Metasploit ModulesPublic exploit moduleexploit_linux/local/sudo_baron_samedit

    Public module reference (excellent). Module source is not copied into this catalog.

    rapid7.com
  • NIST NVDVulnerability recordCVE-2021-3156

    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.

    nvd.nist.gov
  • Packet Storm SecurityCited referencehttp://packetstormsecurity.com/files/161160/Sudo-Heap-Based-Buffer-Overflow.html

    Packet Storm link already published on the finding.

    packetstormsecurity.com
  • Packet Storm SecurityCited referencehttp://packetstormsecurity.com/files/161230/Sudo-Buffer-Overflow-Privilege-Escalation.html

    Packet Storm link already published on the finding.

    packetstormsecurity.com
  • Packet Storm SecurityCited referencehttp://packetstormsecurity.com/files/161270/Sudo-1.9.5p1-Buffer-Overflow-Privilege-Escalation.html

    Packet Storm link already published on the finding.

    packetstormsecurity.com
  • Packet Storm SecurityCited referencehttp://packetstormsecurity.com/files/161293/Sudo-1.8.31p2-1.9.5p1-Buffer-Overflow.html

    Packet Storm link already published on the finding.

    packetstormsecurity.com
  • Packet Storm SecurityCited referencehttp://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html

    Packet Storm link already published on the finding.

    packetstormsecurity.com
  • VulnCheck KEVConfirmed exploitationCVE-2021-3156

    Sudo contains an off-by-one error that can result in a heap-based buffer overflow, which allows for privilege escalation.

    vulncheck.com

References

Freshness

Last verified in this catalog Oct 17, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.