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.
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.