Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 96618 - app-admin/sudo 1.6.8p9 fixes race condition
Summary: app-admin/sudo 1.6.8p9 fixes race condition
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Other
: High major (vote)
Assignee: Gentoo Security
Whiteboard: B1 [glsa] jaervosz
Depends on:
Reported: 2005-06-20 08:56 UTC by Rajiv Aaron Manglani (RETIRED)
Modified: 2005-08-15 21:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Rajiv Aaron Manglani (RETIRED) gentoo-dev 2005-06-20 08:56:21 UTC
	Subject: 	Sudo version 1.6.8p9 now available, fixes security issue.
	Date: 	June 20, 2005 10:24:43 AM EDT

Sudo version 1.6.8, patchlevel 9 is now available, which fixes a
race condition in Sudo's pathname validation.  This is a security

    A race condition in Sudo's command pathname handling prior to
    Sudo version 1.6.8p9 that could allow a user with Sudo privileges
    to run arbitrary commands.

Sudo versions affected:
    Sudo versions 1.3.1 up to and including 1.6.8p8.

    When a user runs a command via Sudo, the inode and device numbers
    of the command are compared to those of commands with the same
    basename found in the sudoers file (see the Background paragraph
    for more information).  When a match is found, the path to the
    matching command listed in the sudoers file is stored in the
    variable safe_cmnd,  which is later used to execute the command.
    Because the actual path executed comes from the sudoers file
    and not directly from the user, Sudo should be safe from race
    conditions involving symbolic links.  However, if a sudoers
    entry containing the pseudo-command ALL follows the user's
    sudoers entry the contents of safe_cmnd will be overwritten
    with the path the user specified on the command line, making
    Sudo vulnerable to the aforementioned race condition.

    Exploitation of the bug requires that the user be allowed to
    run one or more commands via Sudo and be able to create symbolic
    links in the filesystem.  Furthermore, a sudoers entry giving
    another user access to the ALL pseudo-command must follow the
    user's sudoers entry for the race to exist.

    For example, the following sudoers file is not affected by the

	root		server=ALL
	someuser	server=/bin/echo

    Whereas this one would be:

	someuser	server=/bin/echo
	root		server=ALL

    The bug is fixed in sudo 1.6.8p9.

    The administrator can order the sudoers file such that all
    entries granting Sudo ALL privileges precede all other entries.

    This problem was brought to my attention by Charles Morris.

    The reason Sudo uses the inode for command matching is to make
    relative paths work and to avoid problems caused by automounters
    where the path to be executed is not the same as the absolute
    path to the command.

    Another possible approach is to use the realpath() function to
    find the true path.  Sudo does not user realpath() because that
    function is not present in all operating systems and is often
    vulnerable to race conditions where it does exist.

The next major Sudo release will be version 1.7.  For information
on what to expect in sudo 1.7, see
You can help speed the release of Sudo 1.7 by purchasing a support
contract or making a donation (see below).

Commercial support is available for Sudo.  If your organization
uses Sudo, please consider purchasing a support contract to help
fund future Sudo development at
Custom enhancements to Sudo may also be contracted.

You can also help out by making a donation or "purchase" a copy
of Sudo at

Master Web Site:

Web Site Mirrors: (Fremont, California, USA) (Los Angeles, California, USA) (California, USA) (Fanwood, New Jersey, USA) (Bend, Oregon, USA) (Philadelphia, Pennsylvania, USA) (USA) (Argentina) (Australia) (Germany) (Latvia) (Kaunas, Lithuania) (Russia) (Taiwan)

FTP Mirrors: (Boulder, Colorado, USA) (Boulder, Colorado, USA) (Redwood City, California, USA) (Los Angeles, California, USA) (Beltsville, Maryland, USA) (West Lafayette, Indiana, USA) (Bloomington, Indiana, USA) (Rochester, New York, USA) (Chicago, Illinois, USA) (Argentina) (Australia) (Austria) (Alberta, Canada) (Hong Kong, China) (Czechoslovakia) (France) (Frankfurt, Germany) (Japan) (Japan) (Japan) (Japan) (Japan) (Poland) (Russia) (Taiwan)

HTTP Mirrors: (Fremont, California, USA) (California, USA) (San Jose, California, USA) (California, USA) (Rochester, New York, USA) (East Coast, USA) (West Lafayette, Indiana, USA) (California, USA) (Frankfurt, Germany) (Frankfurt, Germany) (Japan) (Japan) (Poland) (Moscow, Russian Federation) (Taiwan)
Comment 1 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2005-06-20 09:01:00 UTC
sudo-1.6.8_p9 is in portage, but currently marked unstable on most arch's.
Comment 2 solar (RETIRED) gentoo-dev 2005-06-20 14:34:40 UTC
Candidate: CAN-2005-1993
Reference: BUGTRAQ:20050620 Sudo version 1.6.8p9 now available, fixes
security issue.
Reference: URL:

Race condition in sudo 1.3.1 up to 1.6.8p8, when the ALL
pseudo-command is used after a user entry in the sudoers file, allows
local users to gain privileges via a symlink attack.
Comment 3 Sune Kloppenborg Jeppesen gentoo-dev 2005-06-20 23:14:17 UTC
Arches please test and mark sudo-1.6.8_p9. 
Comment 4 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-06-20 23:29:08 UTC
Stable on ppc.
Comment 5 Markus Rothe (RETIRED) gentoo-dev 2005-06-20 23:43:43 UTC
stable on ppc64 
Comment 6 René Nussbaumer (RETIRED) gentoo-dev 2005-06-21 01:29:31 UTC
Stable on hppa
Comment 7 Simon Stelling (RETIRED) gentoo-dev 2005-06-21 02:40:15 UTC
amd64 stable
Comment 8 Gustavo Zacarias (RETIRED) gentoo-dev 2005-06-21 11:09:37 UTC
Stable on sparc.
Comment 9 Tim Yamin (RETIRED) gentoo-dev 2005-06-21 11:33:24 UTC
IA64 done and happy.
Comment 10 Fernando J. Pereda (RETIRED) gentoo-dev 2005-06-21 13:42:27 UTC
alpha done for you :)

Comment 11 Sune Kloppenborg Jeppesen gentoo-dev 2005-06-22 09:11:26 UTC
x86 please mark stable. 
Comment 12 Olivier Crete (RETIRED) gentoo-dev 2005-06-22 20:35:05 UTC
stable on x86.. 
Comment 13 Sune Kloppenborg Jeppesen gentoo-dev 2005-06-23 01:18:33 UTC
GLSA 200506-22  
arm, mips, s390 please remember to mark stable to benifit from the GLSA.  
Comment 14 Hardave Riar (RETIRED) gentoo-dev 2005-07-02 12:08:35 UTC
Stable on mips.