Red Hat Security Advisory: sudo security update
🔗 CVE IDs covered (1)
📋 Description
CVE-2021-3156 — sudo: Heap buffer overflow in argument parsing
🎯 Affected products48
- Red Hat Enterprise Linux Client (v. 7)
- Red Hat Enterprise Linux Client Optional (v. 7)
- Red Hat Enterprise Linux ComputeNode Optional (v. 7)
- Red Hat Enterprise Linux Server (v. 7)
- Red Hat Enterprise Linux Server Optional (v. 7)
- Red Hat Enterprise Linux Workstation (v. 7)
- Red Hat Enterprise Linux Workstation Optional (v. 7)
- sudo-0:1.8.23-10.el7_9.1.ppc64 as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-0:1.8.23-10.el7_9.1.ppc64le as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-0:1.8.23-10.el7_9.1.s390x as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-0:1.8.23-10.el7_9.1.src as a component of Red Hat Enterprise Linux Client (v. 7)
- sudo-0:1.8.23-10.el7_9.1.src as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-0:1.8.23-10.el7_9.1.src as a component of Red Hat Enterprise Linux Workstation (v. 7)
- sudo-0:1.8.23-10.el7_9.1.x86_64 as a component of Red Hat Enterprise Linux Client (v. 7)
- sudo-0:1.8.23-10.el7_9.1.x86_64 as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-0:1.8.23-10.el7_9.1.x86_64 as a component of Red Hat Enterprise Linux Workstation (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.i686 as a component of Red Hat Enterprise Linux Client Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.i686 as a component of Red Hat Enterprise Linux ComputeNode Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.i686 as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.i686 as a component of Red Hat Enterprise Linux Workstation Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.ppc as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.ppc64 as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.ppc64 as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.ppc64le as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.ppc64le as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.s390 as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.s390x as a component of Red Hat Enterprise Linux Server (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.s390x as a component of Red Hat Enterprise Linux Server Optional (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.x86_64 as a component of Red Hat Enterprise Linux Client (v. 7)
- sudo-debuginfo-0:1.8.23-10.el7_9.1.x86_64 as a component of Red Hat Enterprise Linux Client Optional (v. 7)
- +18 more not shown
✅ Remediation
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 Workaround: 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)
🔗 References (5)
- selfhttps://access.redhat.com/errata/RHSA-2021:0221
- externalhttps://access.redhat.com/security/updates/classification/#important
- externalhttps://access.redhat.com/security/vulnerabilities/RHSB-2021-002
- externalhttps://bugzilla.redhat.com/show_bug.cgi?id=1917684
- selfhttps://security.access.redhat.com/data/csaf/v2/advisories/2021/rhsa-2021_0221.json