sudo: Stack based buffer overflow when pwfeedback is enabled
Published Jan 29, 2020
7.8
HIGHCVSS 3.1
EPSS 19.28%
Description
In Sudo before 1.8.26, if pwfeedback is enabled in /etc/sudoers, users can trigger a stack-based buffer overflow in the privileged sudo process. (pwfeedback is a default setting in Linux Mint and elementary OS; however, it is NOT the default for upstream and many other packages, and would exist only if enabled by an administrator.) The attacker needs to deliver a long string to the stdin of getln() in tgetpass.c.
Affected products
No data.
Configuration 1
- ≥ 1.7.1 · < 1.8.26
Configuration 2
- 8.0
- 9.0
- 10.0
No data.
Red Hat Enterprise Linux 6
sudo-0:1.8.6p3-29.el6_10.3
Fixed · RHSA-2020:0726
Red Hat Enterprise Linux 7
sudo-0:1.8.23-4.el7_7.2
Fixed · RHSA-2020:0540
Red Hat Enterprise Linux 8
sudo-0:1.8.25p1-8.el8_1.1
Fixed · RHSA-2020:0487
Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions
sudo-0:1.8.25p1-4.el8_0.3
Fixed · RHSA-2020:0509
Red Hat Enterprise Linux 5
sudo
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | sudo-0:1.8.6p3-29.el6_10.3 | Fixed | RHSA-2020:0726 |
| Red Hat Enterprise Linux 7 | sudo-0:1.8.23-4.el7_7.2 | Fixed | RHSA-2020:0540 |
| Red Hat Enterprise Linux 8 | sudo-0:1.8.25p1-8.el8_1.1 | Fixed | RHSA-2020:0487 |
| Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions | sudo-0:1.8.25p1-4.el8_0.3 | Fixed | RHSA-2020:0509 |
| Red Hat Enterprise Linux 5 | sudo | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This flaw can only be exploited if the option `pwfeedback` is enabled in sudo configuration. This option is not enabled by default in any version of Red Hat Enterprise Linux. The sudo packages distributed with Red Hat Enterprise Linux versions are compiled using gcc's stack-protector feature. The "Stack Smashing Protection" may help mitigate code execution attacks for this flaw. Red Hat Enterprise Linux 5 is not affected as it doesn't include the commit which introduced the vulnerability.
Red Hat mitigation
Please follow the steps bellow as mitigation: 1. Check the default properties set for sudo by running: ~~~ $ sudo -l [sudo] password for user: Matching Defaults entries for users on localhost: !visiblepw, pwfeedback, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin ~~~ 2. If `pwfeedback` is enabled as shown above, edit your `/etc/sudoers` file, changing the line: ~~~ Defaults pwfeedback ~~~ To: ~~~ Defaults !pwfeedback ~~~ This will disable visual feedback on password typing, making sure the attack is not possible anymore.
References (30)
- http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00029.html vendor-advisoryx_refsource_SUSE
- http://packetstormsecurity.com/files/156174/Slackware-Security-Advisory-sudo-Updates.html x_refsource_MISCThird Party AdvisoryVDB Entry
- http://packetstormsecurity.com/files/156189/Sudo-1.8.25p-Buffer-Overflow.html x_refsource_MISCThird Party AdvisoryVDB Entry
- http://seclists.org/fulldisclosure/2020/Jan/40 mailing-listx_refsource_FULLDISCMailing ListThird Party Advisory
- http://www.openwall.com/lists/oss-security/2020/01/30/6 mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- http://www.openwall.com/lists/oss-security/2020/01/31/1 mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- http://www.openwall.com/lists/oss-security/2020/02/05/2 mailing-listx_refsource_MLISTThird Party Advisory
- http://www.openwall.com/lists/oss-security/2020/02/05/5 mailing-listx_refsource_MLISTExploitThird Party Advisory
- https://access.redhat.com/errata/RHSA-2020:0487 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2020:0509 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2020:0540 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2020:0726 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2019-18634 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1796944 Issue Tracking
- https://lists.debian.org/debian-lts-announce/2020/02/msg00002.html mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/I6TKF36KOQUVJNBHSVJFA7BU3CCEYD2F/ vendor-advisoryx_refsource_FEDORA
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IY6DZ7WMDKU4ZDML6MJLDAPG42B5WVUC/ vendor-advisoryx_refsource_FEDORA
- https://nvd.nist.gov/vuln/detail/CVE-2019-18634
- https://seclists.org/bugtraq/2020/Feb/2 mailing-listx_refsource_BUGTRAQMailing ListThird Party Advisory
- https://seclists.org/bugtraq/2020/Feb/3 mailing-listx_refsource_BUGTRAQMailing ListThird Party Advisory
- https://seclists.org/bugtraq/2020/Jan/44 mailing-listx_refsource_BUGTRAQMailing ListThird Party Advisory
- https://security.gentoo.org/glsa/202003-12 vendor-advisoryx_refsource_GENTOO
- https://security.netapp.com/advisory/ntap-20200210-0001/ x_refsource_CONFIRM
- https://support.apple.com/kb/HT210919 x_refsource_CONFIRMThird Party Advisory
- https://usn.ubuntu.com/4263-1/ vendor-advisoryx_refsource_UBUNTU
- https://usn.ubuntu.com/4263-2/ vendor-advisoryx_refsource_UBUNTU
- https://www.cve.org/CVERecord?id=CVE-2019-18634
- https://www.debian.org/security/2020/dsa-4614 vendor-advisoryx_refsource_DEBIANThird Party Advisory
- https://www.sudo.ws/alerts/pwfeedback.html x_refsource_CONFIRMExploitVendor Advisory
- https://www.sudo.ws/security.html x_refsource_MISCVendor Advisory
Change history (0)
No recorded changes yet.