Back

HIGH

sudo: Stack based buffer overflow when pwfeedback is enabled

Published Jan 29, 2020

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

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)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner mitre
Published Jan 29, 2020
Updated Aug 5, 2024
Reserved Oct 30, 2019
NVD
Status Modified
Modified Jun 17, 2026
Red Hat
Severity Important
Public date Jan 30, 2020