Red Hat Security Advisory: sudo security update
🔗 CVE IDs covered (1)
📋 Description
CVE-2021-3156 — sudo: Heap buffer overflow in argument parsing
🎯 Affected products31
- Red Hat Enterprise Linux Server AUS (v. 7.4)
- Red Hat Enterprise Linux Server E4S (v. 7.4)
- Red Hat Enterprise Linux Server Optional AUS (v. 7.4)
- Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- Red Hat Enterprise Linux Server Optional TUS (v. 7.4)
- Red Hat Enterprise Linux Server TUS (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.ppc64le as a component of Red Hat Enterprise Linux Server E4S (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.src as a component of Red Hat Enterprise Linux Server AUS (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.src as a component of Red Hat Enterprise Linux Server E4S (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.src as a component of Red Hat Enterprise Linux Server TUS (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server AUS (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server E4S (v. 7.4)
- sudo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server TUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional AUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional TUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.ppc64le as a component of Red Hat Enterprise Linux Server E4S (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.ppc64le as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server AUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server E4S (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server Optional AUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server Optional TUS (v. 7.4)
- sudo-debuginfo-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server TUS (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional AUS (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.i686 as a component of Red Hat Enterprise Linux Server Optional TUS (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.ppc64le as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server Optional AUS (v. 7.4)
- sudo-devel-0:1.8.19p2-12.el7_4.2.x86_64 as a component of Red Hat Enterprise Linux Server Optional E4S (v. 7.4)
- +1 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:0224
- 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_0224.json