CVE Database›Document archive›CVE-2019-18634

CVE-2019-18634

sudo: Stack based buffer overflow when pwfeedback is enabled

Loading…

Severity

Important

Red Hat Product Security

7.8

CVSS 3.1

Review impact separately from score.

Published · January 30, 2020

Updated · November 22, 2025

Description

A flaw was found in the Sudo application when the ’pwfeedback' option is set to true on the sudoers file. An authenticated user can use this vulnerability to trigger a stack-based buffer overflow under certain conditions even without Sudo privileges. The buffer overflow may allow an attacker to expose or corrupt memory information, crash the Sudo application, or possibly inject code to be run as a root user.

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.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

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.

CVSS / CWE

CVSS 3.1 · 7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CWE-121 · Stack-based Buffer Overflow