oss-sec mailing list archives

Re: race condition checking digests/checksums in sudoers


From: Tomas Hoger <thoger () redhat com>
Date: Tue, 1 Dec 2015 13:29:00 +0100

On Tue, 10 Nov 2015 00:23:14 +0000 Alyssa Milburn wrote:

Recent releases of sudo (since 1.8.7) support SHA-2 digests in the sudoers
file, which the documentation states "may be useful in situations where the
user invoking sudo has write access to the command or its parent directory".

The sudoers plugin performs this digest verification while matching rules,
and later independently calls execve() to execute the binary. This results
in a race condition if the digest functionality is used as suggested (in
fact, the rules are matched before the user is prompted for a password, so
you have quite some time to replace the binary from underneath sudo).

I'm not sure whether this problem is interesting enough to announce or not;
I imagine this functionality isn't widely used, but it's clearly unsafe to
use in such situations right now, and it seems like it would be a can of
worms (at best) to make it completely safe.

Was any fix for this issue already applied, or is any fix planned at
all?  Looking at upstream hg and changelog, it does not seem there's
any change related to this report yet.

-- 
Tomas Hoger / Red Hat Product Security


Current thread: