Bug 1917684 (CVE-2021-3156)
Summary: | CVE-2021-3156 sudo: Heap buffer overflow in argument parsing | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Other] Security Response | Reporter: | Huzaifa S. Sidhpurwala <huzaifas> | ||||||
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> | ||||||
Status: | CLOSED ERRATA | QA Contact: | |||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | unspecified | CC: | alakatos, anazmy, cperry, dapospis, dblechte, dchong, dfediuck, dramseur, eedri, emarcus, fcanogab, fche, jburrell, jhunter, jligon, jminter, jwest, kmitts, kzak, lvrabec, mattdm, mgala, mgoldboi, miabbott, michal.skrivanek, mjudeiki, nlevy, psampaio, rsroka, sbonazzo, security-response-team, sherold, smilner, sparpate, tosykora, yozone, yturgema, zfridric | ||||||
Target Milestone: | --- | Keywords: | Security | ||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | sudo 1.9.5p2 | Doc Type: | Known Issue | ||||||
Doc Text: |
A flaw was found in sudo. A heap-based buffer overflow was found in the way sudo parses command line arguments. This flaw is exploitable by any local user who can execute the sudo command (by default, any local user can execute sudo) without authentication. Successful exploitation of this flaw could lead to privilege escalation. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2021-01-26 22:46:50 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | 1917723, 1917724, 1917725, 1917727, 1917728, 1917729, 1917730, 1917731, 1917732, 1917733, 1917734, 1917735, 1917741, 1918198, 1918199, 1918200, 1918201, 1919880, 1920485, 1920487, 1920618 | ||||||||
Bug Blocks: | 1917685 | ||||||||
Attachments: |
|
Description
Huzaifa S. Sidhpurwala
2021-01-19 06:44:18 UTC
Created attachment 1748637 [details]
Upstream patch
Created attachment 1748935 [details]
New upstream patch (the first patch breaks -P option)
Created sudo tracking bugs for this issue: Affects: fedora-all [bug 1920618] This issue has been addressed in the following products: Red Hat Enterprise Linux 7.2 Advanced Update Support Via RHSA-2021:0226 https://access.redhat.com/errata/RHSA-2021:0226 This issue has been addressed in the following products: Red Hat Enterprise Linux 8.1 Extended Update Support Via RHSA-2021:0220 https://access.redhat.com/errata/RHSA-2021:0220 This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2021:0218 https://access.redhat.com/errata/RHSA-2021:0218 This issue has been addressed in the following products: Red Hat Enterprise Linux 7.3 Advanced Update Support Via RHSA-2021:0225 https://access.redhat.com/errata/RHSA-2021:0225 This issue has been addressed in the following products: Red Hat Enterprise Linux 8.2 Extended Update Support Via RHSA-2021:0219 https://access.redhat.com/errata/RHSA-2021:0219 This issue has been addressed in the following products: Red Hat Enterprise Linux 6 Extended Lifecycle Support Via RHSA-2021:0227 https://access.redhat.com/errata/RHSA-2021:0227 This issue has been addressed in the following products: Red Hat Enterprise Linux 7.4 Advanced Update Support Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions Red Hat Enterprise Linux 7.4 Telco Extended Update Support Via RHSA-2021:0224 https://access.redhat.com/errata/RHSA-2021:0224 This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2021:0221 https://access.redhat.com/errata/RHSA-2021:0221 This issue has been addressed in the following products: Red Hat Enterprise Linux 7.7 Extended Update Support Via RHSA-2021:0222 https://access.redhat.com/errata/RHSA-2021:0222 This issue has been addressed in the following products: Red Hat Enterprise Linux 7.6 Extended Update Support Via RHSA-2021:0223 https://access.redhat.com/errata/RHSA-2021:0223 This bug is now closed. Further updates for individual products will be reflected on the CVE page(s): https://access.redhat.com/security/cve/cve-2021-3156 External References: https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt https://www.sudo.ws/alerts/unescape_overflow.html Upstream patchset: https://github.com/sudo-project/sudo/commit/1f8638577d0c80a4ff864a2aad80a0d95488e9a8 https://github.com/sudo-project/sudo/commit/b301b46b79c6e2a76d530fa36d05992e74952ee8 https://github.com/sudo-project/sudo/commit/c4d384082fdbc8406cf19e08d05db4cded920a55 This issue was fixed upstream in version 1.9.5p2: https://www.sudo.ws/stable.html#1.9.5p2 Statement: 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. This issue has been addressed in the following products: Red Hat Virtualization 4 for Red Hat Enterprise Linux 7 Via RHSA-2021:0395 https://access.redhat.com/errata/RHSA-2021:0395 This issue has been addressed in the following products: Red Hat Virtualization 4 for Red Hat Enterprise Linux 8 Via RHSA-2021:0401 https://access.redhat.com/errata/RHSA-2021:0401 Mitigation: 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) |