guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Potential security weakness in Guix services


From: Ludovic Courtès
Subject: Re: Potential security weakness in Guix services
Date: Sat, 06 Feb 2021 22:26:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> On Fri, 2021-02-05 at 10:57 +0100, Ludovic Courtès wrote:
>> Hi Maxime,
>
>> 
>> > I don't know how I should implement this properly in Guile, though.
>> > In C, I would use loop using openat with O_NOFOLLOW, in combination
>> > with stat, but Guile doesn't have openat or O_NOFOLLOW.
>> 
>> In this case we need a solution without openat for now.  Perhaps simply
>> changing ‘mkdir-p/perms’ to ‘lstat’ components as it goes?
>
> A compromised service could create a component as a regular file or
> directory, and quickly replace it with a symlink after the activation
> gexp checks the component wasn't a symlink but before the chown or
> chmod.

I understand the TOCTTOU race.  However, activation code runs in two
situations: when booting the system (before shepherd takes over), and
upon ‘guix system reconfigure’ completion.

When booting the system, there’s just no process out there to take
advantage of the race condition.

In the second case, presumably all the file name components already
exist.

Does that make sense?

>> > [...]
>> > I'll look into writing a concrete proposal for *at in guile.
>> > I'll post a link to the guile mailing list message when it has
>> > been composed and sent.
>
> Link: https://lists.gnu.org/archive/html/bug-guile/2021-02/msg00002.html

Thanks!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]