CyberSecBulletin
CVE-2021-3156Exploited in the wildNVD status: Analyzed

Sudo Heap-Based Buffer Overflow

CVE-2021-3156 is a high-severity off-by-one error vulnerability in Sudo from Sudo Project, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 1.8.32, 1.9.5 as the first without the flaw, so updating Sudo to one of those releases or later removes the exposure. CISA added it to the Known Exploited Vulnerabilities catalogue on April 6, 2022, which means attacks have been observed in the wild.

Patch now

Attackers are already exploiting this vulnerability, according to CISA.

What to do

  1. Update Sudo to 1.8.32 or 1.9.5, whichever matches your release line, or a later version.
  2. Update Privilege Management For Mac to 21.1.1 or a later version.
  3. Update Privilege Management For Unix/linux to 10.3.2-10 or a later version.
  4. CISA's required action: Apply updates per vendor instructions.
  5. Read the advisory on beyondtrust.com for workarounds and exact fixed builds.

Affected products and versions

VendorProductAffected versionsFixed in
Sudo ProjectSudo1.8.2 up to, but not including, 1.8.32; 1.9.0 up to, but not including, 1.9.5; 1.9.51.8.32, 1.9.5
Fedora ProjectFedora32; 33Not stated
DebianDebian Linux9.0; 10.0Not stated
NetAppActive Iq Unified ManagerNot specified in the recordNot stated
NetAppCloud BackupNot specified in the recordNot stated
NetAppHci Management NodeNot specified in the recordNot stated
NetAppOncommand Unified Manager Core PackageNot specified in the recordNot stated
NetAppOntap Select Deploy Administration UtilityNot specified in the recordNot stated
NetAppOntap Tools9Not stated
NetAppSolidfireNot specified in the recordNot stated
McAfeeWeb Gateway8.2.17; 9.2.8; 10.0.4Not stated
SynologyDiskstation Manager Unified Controller3.0Not stated
SynologyDiskstation Manager6.2Not stated
SynologySkynas FirmwareNot specified in the recordNot stated
SynologyVs960hd FirmwareNot specified in the recordNot stated
BeyondtrustPrivilege Management For Macbefore 21.1.121.1.1
BeyondtrustPrivilege Management For Unix/linuxbefore 10.3.2-1010.3.2-10
OracleMicros Compact Workstation 3 Firmware310Not stated
OracleMicros Es400 Firmware400 through 410Not stated
OracleMicros Kitchen Display System Firmware210Not stated
OracleMicros Workstation 5a Firmware5aNot stated
OracleMicros Workstation 6 Firmware610 through 655Not stated
OracleCommunications Performance Intelligence Center10.3.0.0.0 through 10.3.0.2.1; 10.4.0.1.0 through 10.4.0.3.1Not stated
OracleTekelec Platform Distribution7.4.0 through 7.7.1Not stated

Version data comes from NVD's product matching. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighNVD
CVSS 3.17.8HighCISA (ADP)
CVSS 2.07.2HighNVD

Official description

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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Off-by-one Error

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

How developers prevent this class of flaw

  • When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().

More Off-by-one Error vulnerabilities (CWE-193)

Timeline

  1. CVE record published.
  2. Added to CISA's Known Exploited Vulnerabilities catalogue.
  3. Deadline for US federal agencies to remediate, set by CISA.
  4. CISA published its SSVC assessment (exploitation: active, automatable: no, technical impact: total).
  5. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Technical write-ups (may include proof of concept)

Other vulnerabilities in Sudo

All Sudo vulnerabilities

Spotted an error? Tell us.