FreeBSD VuXML: Documenting security issues in FreeBSD and the FreeBSD Ports Collection

sudo -- Privilege escalation with sudoedit

Affected packages
sudo < 1.7.2.4

Details

VuXML ID 018a84d0-2548-11df-b4a3-00e0815b8da8
Discovery 2010-01-29
Entry 2010-03-01

Todd Miller reports:

When sudo performs its command matching, there is a special case for pseudo-commands in the sudoers file (currently, the only pseudo-command is sudoedit). Unlike a regular command, pseudo-commands do not begin with a slash ('/'). The flaw is that sudo's the matching code would only check against the list of pseudo-commands if the user-specified command also contained no slashes. As a result, if the user ran "sudo ./sudoedit" the normal matching code path was followed, which uses stat(2) to verify that the user-specified command matches the one in sudoers. In this case, it would compare the "./sudoedit" specified by the user with "sudoedit" from the sudoers file, resulting in a positive match.

References

Bugtraq ID 38362
CVE Name CVE-2010-0426
URL http://secunia.com/advisories/38659
URL http://www.sudo.ws/pipermail/sudo-announce/2010-February/000092.html
URL http://www.sudo.ws/sudo/alerts/sudoedit_escalate.html