what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

sudo168-9.txt

sudo168-9.txt
Posted Jun 21, 2005
Site sudo.ws

A race condition exists 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.

tags | advisory, arbitrary
SHA-256 | a70767bc3df652f28565e7a7ef5f5857dd8f651bee8d0dcfe89f265f2852c080

sudo168-9.txt

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

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

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

Impact:
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
bug:

root server=ALL
someuser server=/bin/echo

Whereas this one would be:

someuser server=/bin/echo
root server=ALL

Fix:
The bug is fixed in sudo 1.6.8p9.

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

Credit:
This problem was brought to my attention by Charles Morris.

Background:
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 https://www.sudo.ws/sudo/future.html
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 https://www.sudo.ws/support.html
Custom enhancements to Sudo may also be contracted.

You can also help out by making a donation or "purchase" a copy
of Sudo at https://www.sudo.ws/purchase.html

Master Web Site:
https://www.sudo.ws/sudo/

Web Site Mirrors:
https://www.mirrormonster.com/sudo/ (Fremont, California, USA)
https://sudo.stikman.com/ (Los Angeles, California, USA)
https://sudo.tolix.org/ (California, USA)
https://mirage.informationwave.net/sudo/ (Fanwood, New Jersey, USA)
https://www.mrv2k.net/sudo/ (Bend, Oregon, USA)
https://sudo.rtin.bz/ (Philadelphia, Pennsylvania, USA)
https://www.signal42.com/mirrors/sudo_www/ (USA)
https://sudo.xmundo.net/ (Argentina)
https://sudo.planetmirror.com/ (Australia)
https://mirror.mons-new-media.de/sudo/ (Germany)
https://sunshine.lv/sudo/ (Latvia)
https://rexem.uni.cc/sudo/ (Kaunas, Lithuania)
https://sudo.cdu.elektra.ru/ (Russia)
https://sudo.nctu.edu.tw/ (Taiwan)

FTP Mirrors:
ftp://plier.ucar.edu/pub/sudo/ (Boulder, Colorado, USA)
ftp://ftp.cs.colorado.edu/pub/sudo/ (Boulder, Colorado, USA)
ftp://obsd.isc.org/pub/sudo/ (Redwood City, California, USA)
ftp://ftp.stikman.com/pub/sudo/ (Los Angeles, California, USA)
ftp://ftp.tux.org/pub/security/sudo/ (Beltsville, Maryland, USA)
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/sudo/ (West Lafayette, Indiana, USA)
ftp://ftp.uwsg.indiana.edu/pub/security/sudo/ (Bloomington, Indiana, USA)
ftp://ftp.rge.com/pub/admin/sudo/ (Rochester, New York, USA)
ftp://mirror.sg.depaul.edu/pub/security/sudo/ (Chicago, Illinois, USA)
ftp://sudo.xmundo.net/pub/mirrors/sudo/ (Argentina)
ftp://ftp.wiretapped.net/pub/security/host-security/sudo/ (Australia)
ftp://ftp.tuwien.ac.at/utils/admin-tools/sudo/ (Austria)
ftp://sunsite.ualberta.ca/pub/Mirror/sudo/ (Alberta, Canada)
ftp://ftp.csc.cuhk.edu.hk/pub/packages/unix-tools/sudo/ (Hong Kong, China)
ftp://ftp.eunet.cz/pub/security/sudo/ (Czechoslovakia)
ftp://ftp.ujf-grenoble.fr/sudo/ (France)
ftp://netmirror.org/ftp.sudo.ws/ (Frankfurt, Germany)
ftp://ftp.win.ne.jp/pub/misc/sudo/ (Japan)
ftp://ftp.st.ryukoku.ac.jp/pub/security/tool/sudo/ (Japan)
ftp://ftp.cin.nihon-u.ac.jp/pub/misc/sudo/ (Japan)
ftp://core.ring.gr.jp/pub/misc/sudo/ (Japan)
ftp://ftp.ring.gr.jp/pub/misc/sudo/ (Japan)
ftp://ftp.tpnet.pl/d6/ftp.sudo.ws/ (Poland)
ftp://ftp.cdu.elektra.ru/pub/unix/security/sudo/ (Russia)
ftp://ftp.nsysu.edu.tw/Unix/Security/Sudo/ (Taiwan)

HTTP Mirrors:
https://www.mirrormonster.com/sudo/dist/ (Fremont, California, USA)
https://sudo.tolix.org/ftp/ (California, USA)
https://sudo.mirror99.com/ (San Jose, California, USA)
https://www.signal42.com/mirrors/sudo_ftp/ (California, USA)
https://www.rge.com/pub/admin/sudo/ (Rochester, New York, USA)
https://probsd.org/sudoftp/ (East Coast, USA)
https://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/sudo/ (West Lafayette, Indiana, USA)
https://www.signal42.com/mirrors/sudo_ftp/ (California, USA)
https://netmirror.org/mirror/ftp.sudo.ws/ (Frankfurt, Germany)
https://mirror.mons-new-media.de/sudo_ftp/ (Frankfurt, Germany)
https://core.ring.gr.jp/archives/misc/sudo/ (Japan)
https://www.ring.gr.jp/archives/misc/sudo/ (Japan)
https://ftp.tpnet.pl/vol/d6/ftp.sudo.ws/ (Poland)
https://sudo.tsuren.net/dist/ (Moscow, Russian Federation)
https://ftp.nsysu.edu.tw/Unix/Security/Sudo/ (Taiwan)
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close