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

High severity, CVSS 7.8. Actively exploited: in CISA KEV since 2022-04-06. EPSS: >99% probability of exploitation activity in the next 30 days.

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.

What to do

CISA's required action (US federal agencies, by 2022-04-27): Apply updates per vendor instructions.

The record states a fixed version for each range of affected versions. Update to the one for the range your version is in: a later release on another branch may not have the fix.

  • BeyondTrust Privilege Management For Mac, before 21.1.1: fixed in 21.1.1
  • BeyondTrust Privilege Management For Unix/linux, before 10.3.2-10: fixed in 10.3.2-10
  • Sudo Project Sudo, from 1.8.2, before 1.8.32: fixed in 1.8.32
  • Sudo Project Sudo, from 1.9.0, before 1.9.5: fixed in 1.9.5

Affected products

Published 2021-01-26. Last modified 2026-06-17.