CVSS 3.1
7.8 highCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HKnown as Baron Samedit
High (7.8) in Sudo Sudo. In CISA KEV since 2022-04-06. EPSS >99.9% estimated probability of exploitation activity in the next 30 days.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HExplain CVE-2021-3156 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-3156?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-3156?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-3156 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.
From the NVD's CPE matches.
| Product | Affected |
|---|---|
| sudo_project:sudo | from 1.8.2 before 1.8.32 |
| sudo_project:sudo | from 1.9.0 before 1.9.5 |
| sudo_project:sudo | 1.9.5 |
| sudo_project:sudo | 1.9.5:patch1 |
| fedoraproject:fedora | 32 |
| fedoraproject:fedora | 33 |
| debian:debian_linux | 9.0 |
| debian:debian_linux | 10.0 |
| netapp:ontap_tools | 9 |
| mcafee:web_gateway | 8.2.17 |
| mcafee:web_gateway | 9.2.8 |
| mcafee:web_gateway | 10.0.4 |
| synology:diskstation_manager_unified_controller | 3.0 |
| synology:diskstation_manager | 6.2 |
| beyondtrust:privilege_management_for_mac | before 21.1.1 |
| beyondtrust:privilege_management_for_unix/linux | before 10.3.2-10 |
| oracle:micros_compact_workstation_3_firmware | 310 |
| oracle:micros_es400_firmware | from 400 through 410 |
| oracle:micros_kitchen_display_system_firmware | 210 |
| oracle:micros_workstation_5a_firmware | 5a |
| oracle:micros_workstation_6_firmware | from 610 through 655 |
| oracle:communications_performance_intelligence_center | from 10.3.0.0.0 through 10.3.0.2.1 |
| oracle:communications_performance_intelligence_center | from 10.4.0.1.0 through 10.4.0.3.1 |
| oracle:tekelec_platform_distribution | from 7.4.0 through 7.7.1 |
| Distribution | Release | Package | Fixed in | Advisory |
|---|---|---|---|---|
| Debian | 9 | sudo | 1.8.19p1-2.1+deb9u3 | DLA-2534-1 |
| Debian | 10 | sudo | 1.8.27-1+deb10u3 | DSA-4839-1 |
| Debian | 12, 13, 14 | sudo | 1.9.5p1-1.1 | DEBIAN-CVE-2021-3156 |
| Ubuntu | 16.04:LTS | sudo | 1.8.16-0ubuntu1.10 | UBUNTU-CVE-2021-3156 USN-4705-1 |
| Ubuntu | 18.04:LTS | sudo | 1.8.21p2-3ubuntu1.4 | UBUNTU-CVE-2021-3156 USN-4705-1 |
| Ubuntu | 20.04:LTS | sudo | 1.8.31-1ubuntu1.2 | UBUNTU-CVE-2021-3156 USN-4705-1 |
| Ubuntu | Pro:14.04:LTS | sudo | 1.8.9p5-1ubuntu1.5+esm6 | UBUNTU-CVE-2021-3156 USN-4705-2 |
| Red Hat | enterprise_linux:7::client, enterprise_linux:7::server, enterprise_linux:7::workstation | sudo, sudo-devel, sudo-debuginfo | 0:1.8.23-10.el7_9.1 | RHSA-2021:0221 |
| Red Hat | enterprise_linux:7::computenode | sudo-devel, sudo-debuginfo | 0:1.8.23-10.el7_9.1 | RHSA-2021:0221 |
| Red Hat | enterprise_linux:7::hypervisor | redhat-virtualization-host, redhat-virtualization-host-image-update | 0:4.3.13-20210127.0.el7_9 | RHSA-2021:0395 |
| Red Hat | enterprise_linux:8::baseos | sudo, sudo-debuginfo, sudo-debugsource | 0:1.8.29-6.el8_3.1 | RHSA-2021:0218 |
| Red Hat | rhel_aus:7.2::server | sudo, sudo-devel, sudo-debuginfo | 0:1.8.6p7-17.el7_2.3 | RHSA-2021:0226 |
| Red Hat | rhel_aus:7.3::server | sudo, sudo-devel, sudo-debuginfo | 0:1.8.6p7-23.el7_3.3 | RHSA-2021:0225 |
| Red Hat | rhel_aus:7.4::server, rhel_e4s:7.4::server, rhel_tus:7.4::server | sudo, sudo-devel, sudo-debuginfo | 0:1.8.19p2-12.el7_4.2 | RHSA-2021:0224 |
| Red Hat | rhel_els:6 | sudo, sudo-devel, sudo-debuginfo | 0:1.8.6p3-29.el6_10.4 | RHSA-2021:0227 |
| Red Hat | rhel_eus:7.6::computenode, rhel_eus:7.6::server | sudo, sudo-devel, sudo-debuginfo | 0:1.8.23-3.el7_6.2 | RHSA-2021:0223 |
| Red Hat | rhel_eus:7.7::computenode, rhel_eus:7.7::server | sudo, sudo-devel, sudo-debuginfo | 0:1.8.23-4.el7_7.3 | RHSA-2021:0222 |
| Red Hat | rhel_eus:8.1::baseos | sudo, sudo-debuginfo, sudo-debugsource | 0:1.8.25p1-8.el8_1.2 | RHSA-2021:0220 |
| Red Hat | rhel_eus:8.2::baseos | sudo, sudo-debuginfo, sudo-debugsource | 0:1.8.29-5.el8_2.1 | RHSA-2021:0219 |
| 1 more for Red Hat in the JSON and on Red Hat's page. | ||||
| SUSE | Enterprise Storage 5, HPE Helion OpenStack 8, Linux Enterprise Server 12 SP3-BCL and 8 more | sudo | 1.8.20p2-3.20.1 | SUSE-SU-2021:0226-1 |
| SUSE | Enterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 12 more | sudo | 1.8.22-4.18.1 | SUSE-SU-2021:1275-1 |
| SUSE | Enterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 12 more | sudo | 1.8.22-4.15.1 | SUSE-SU-2021:0227-1 |
| SUSE | HPE Helion OpenStack 8, Linux Enterprise Server 12 SP3-BCL, Linux Enterprise Server 12 SP3-LTSS and 7 more | sudo | 1.8.20p2-3.23.1 | SUSE-SU-2021:1273-1 |
| SUSE | Linux Enterprise Server 12 SP2-BCL | sudo | 1.8.10p3-10.35.1 | SUSE-SU-2021:1267-1 |
| SUSE | Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP2-LTSS, Linux Enterprise Server for SAP Applications 12 SP2 and 1 more | sudo | 1.8.10p3-10.29.1 | SUSE-SU-2021:0232-1 |
| SUSE | Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP2-LTSS, Linux Enterprise Server for SAP Applications 12 SP2 and 1 more | sudo | 1.8.10p3-10.32.1 | SUSE-SU-2021:0928-1 |
| SUSE | Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5 | sudo | 1.8.27-4.15.1 | SUSE-SU-2021:1274-1 |
| SUSE | Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5 | sudo | 1.8.27-4.6.1 | SUSE-SU-2021:0225-1 |
| SUSE | Linux Enterprise Server 12 SP5-LTSS, Linux Enterprise Server LTSS Extended Security 12 SP5 | sudo | 1.8.27-4.51.1 | SUSE-SU-2024:4389-1 |
| openSUSE | Leap 15.1 | sudo | 1.8.22-lp151.5.12.1 | openSUSE-SU-2021:0169-1 |
| openSUSE | Leap 15.2 | sudo | 1.8.22-lp152.8.6.1 | openSUSE-SU-2021:0170-1 |
| openSUSE | Leap 15.2 | sudo | 1.8.22-lp152.8.9.1 | openSUSE-SU-2021:0602-1 |
| openSUSE | Tumbleweed | sudo | 1.9.7p2-1.4 | openSUSE-SU-2024:11413-1 |
| Alpine | v3.10, v3.12, v3.13 and 5 more | sudo | 1.9.5p2-r0 | ALPINE-CVE-2021-3156 |
| Alpine | v3.11 | sudo | 1.8.31-r1 | ALPINE-CVE-2021-3156 |
| Alpine | v3.19, v3.20, v3.21 and 3 more | sudo | 1.9.5_p2-r0 | ALPINE-CVE-2021-3156 |
From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.
Red Hat rates this Important.
This flaw does not affect the versions of sudo shipped with Red Hat Enterprise Linux 5, because the vulnerable code was not present in these versions.
Red Hat Product Security strongly recommends customers to update to fixed sudo packages once they are available. For customers who cannot update immediately, the following interim partial mitigation using systemtap is suggested:
1. Install required systemtap packages and dependencies:
```
systemtap yum-utils kernel-devel-"$(uname -r)"
```
Then for RHEL 7 install kernel debuginfo, using:
```
debuginfo-install -y kernel-"$(uname -r)"
```
Then for RHEL 8 & 6 install sudo debuginfo, using:
```
debuginfo-install sudo
```
2. Create the following systemtap script: (call the file as sudoedit-block.stap)
```
probe process("/usr/bin/sudo").function("main") {
command = cmdline_args(0,0,"");
if (isinstr(command, "edit")) {
raise(9);
}
}
```
3. Install the script using the following command: (using root)
```
# nohup stap -g sudoedit-block.stap &
```
(This should output the PID number of the systemtap script)
This script will cause the vulnerable sudoedit binary to stop working. The sudo command will still work as usual.
The above change does not persist across reboots and must be applied after each reboot.
Please consult How to make a systemtap kernel module load persistently across reboots? (https://access.redhat.com/solutions/5752521) to learn how to
turn this into a service managed by initd.
4. Once the new fixed packages are installed, the systemtap script can be removed by killing the systemtap process. For example, by using:
```
# kill -s SIGTERM 7590
```
(where 7590 is the PID of the systemtap process)
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 Extended Lifecycle Support | sudo-0:1.8.6p3-29.el6_10.4 | Fixed 2021-01-26 | RHSA-2021:0227 |
| Red Hat Enterprise Linux 7 | sudo-0:1.8.23-10.el7_9.1 | Fixed 2021-01-27 | RHSA-2021:0221 |
| Red Hat Enterprise Linux 7.2 Advanced Update Support | sudo-0:1.8.6p7-17.el7_2.3 | Fixed 2021-01-26 | RHSA-2021:0226 |
| Red Hat Enterprise Linux 7.3 Advanced Update Support | sudo-0:1.8.6p7-23.el7_3.3 | Fixed 2021-01-26 | RHSA-2021:0225 |
| Red Hat Enterprise Linux 7.4 Advanced Update Support | sudo-0:1.8.19p2-12.el7_4.2 | Fixed 2021-01-26 | RHSA-2021:0224 |
| Red Hat Enterprise Linux 7.4 Telco Extended Update Support | sudo-0:1.8.19p2-12.el7_4.2 | Fixed 2021-01-26 | RHSA-2021:0224 |
| Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions | sudo-0:1.8.19p2-12.el7_4.2 | Fixed 2021-01-26 | RHSA-2021:0224 |
| Red Hat Enterprise Linux 7.6 Extended Update Support | sudo-0:1.8.23-3.el7_6.2 | Fixed 2021-01-27 | RHSA-2021:0223 |
| Red Hat Enterprise Linux 7.7 Extended Update Support | sudo-0:1.8.23-4.el7_7.3 | Fixed 2021-01-26 | RHSA-2021:0222 |
| Red Hat Enterprise Linux 8 | sudo-0:1.8.29-6.el8_3.1 | Fixed 2021-01-26 | RHSA-2021:0218 |
| Red Hat Enterprise Linux 8.1 Extended Update Support | sudo-0:1.8.25p1-8.el8_1.2 | Fixed 2021-01-26 | RHSA-2021:0220 |
| Red Hat Enterprise Linux 8.2 Extended Update Support | sudo-0:1.8.29-5.el8_2.1 | Fixed 2021-01-26 | RHSA-2021:0219 |
| Red Hat Virtualization 4 for Red Hat Enterprise Linux 7 | redhat-virtualization-host-0:4.3.13-20210127.0.el7_9 | Fixed 2021-02-03 | RHSA-2021:0395 |
| Red Hat Virtualization 4 for Red Hat Enterprise Linux 8 | redhat-virtualization-host-0:4.4.4-20210201.0.el8_3 | Fixed 2021-02-03 | RHSA-2021:0401 |
| Red Hat Enterprise Linux 5 | sudo | Not affected | |
| Red Hat Enterprise Linux 9 | sudo | Not affected |
Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-3156.
| Advisory | Title | Published | Sectors | Affected | Fixed |
|---|---|---|---|---|---|
| ICSA-22-256-01 | Hitachi Energy TXpert Hub CoreTec 4 Sudo Vulnerability | 2022-09-13 | Energy | TXpert Hub CoreTec 4: version 2.0.0 2.0.1, TXpert Hub CoreTec 4: version 2.1.0 2.1.1 2.1.2 2.1.3, TXpert Hub CoreTec 4: version 2.2.0 2.2.1 | none listed |
| ICSA-21-334-04 | Johnson Controls CEM Systems AC2000 | 2021-11-30 | Critical Manufacturing | CEM Systems AC2000: All versions prior to Version 10.6 | none listed |
| ICSA-21-245-01 | Johnson Controls Sensormatic Electronics Illustra | 2021-09-02 | Critical Manufacturing | Insight: All versions prior to 1.4.0, Pro 2: All versions, Flex Gen 2: All versions prior to 1.9.4 and 1 more | none listed |
| ICSA-21-147-02 | Johnson Controls Sensormatic Electronics VideoEdge | 2021-05-27 | Critical Manufacturing | VideoEdge: versions prior to 5.7.0 | none listed |
| ICSA-21-133-02 | Johnson Controls Sensormatic Tyco AI | 2021-05-13 | Critical Manufacturing | Tyco AI: All versions up to and including v1.2 | none listed |
| ICSA-21-119-03 | Johnson Controls Exacq Technologies exacqVision | 2021-04-29 | Critical Manufacturing | exacqVision - Linux based Z-Series and A-Series, exacqVision - Q-Series, exacqVision - G-Series and 5 more | none listed |
From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.
Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.