Bugzilla – Bug 91569
VUL-0: CVE-2005-1993: sudo is vulnerable to a race condition
Last modified: 2021-11-04 16:20:09 UTC
Hi, we got the following mails via vendor-sec (it's public) ----- Forwarded message from "Todd C. Miller" <Todd.Miller@courtesan.com> ----- To: vendor-sec@lst.de From: "Todd C. Miller" <Todd.Miller@courtesan.com> Subject: [vendor-sec] Sudo version 1.6.8p9 now available, fixes security issue. Errors-To: vendor-sec-admin@lst.de Date: Mon, 20 Jun 2005 08:24:16 -0600 This is public. - todd 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 http://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 http://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 http://www.sudo.ws/purchase.html Master Web Site: http://www.sudo.ws/sudo/
To: Josh Bressers <bressers@redhat.com> Cc: vendor-sec@lst.de Subject: Re: [vendor-sec] Sudo version 1.6.8p9 now available, fixes security issue. From: "Todd C. Miller" <Todd.Miller@courtesan.com> Errors-To: vendor-sec-admin@lst.de Date: Mon, 20 Jun 2005 10:16:07 -0600 In message <20050620160823.GR28017@devserv.devel.redhat.com> so spake Josh Bressers (bressers): > The details of this issue have me confused. Does the user have to be able > to create a symlink anywhere on the disk, or in a privileged location (ie > /usr/bin)? Anywhere. - todd _______________________________________________ Vendor Security mailing list
====================================================== Candidate: CAN-2005-1993 URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-1993 Reference: BUGTRAQ:20050620 Sudo version 1.6.8p9 now available, fixes security issue. Reference: URL:http://www.securityfocus.com/archive/1/402741 Reference: CONFIRM:https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=161116 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.
Created attachment 39552 [details] sudo-test.sh demo exploit test case
Created attachment 39553 [details] sudo.diff
SM-Tracker-1615
major... please provide fix within the next days
Marian? are you there?
fixes submited
Thanks! /work/src/done/PATCHINFO/sudo.patch.maintained /work/src/done/PATCHINFO/sudo.patch.box
packages approved, will release advisory ASAP.
CVE-2005-1993: CVSS v2 Base Score: 3.7 (AV:L/AC:H/Au:N/C:P/I:P/A:P)