GNU bug report logs

#48146 Getting diverted to non-updated branches: a limitation of the authentication mechanism?

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #11 received at 48146@debbugs.gnu.org (full text, mbox, reply):

Received: (at 48146) by debbugs.gnu.org; 5 May 2021 20:34:24 +0000
From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 16:34:24 2021
Received: from localhost ([127.0.0.1]:34327 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1leODv-0004GM-PF
	for submit@debbugs.gnu.org; Wed, 05 May 2021 16:34:24 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51328)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@gnu.org>) id 1leODt-0004GG-7Q
 for 48146@debbugs.gnu.org; Wed, 05 May 2021 16:34:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:32768)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@gnu.org>)
 id 1leODn-0007PN-GX; Wed, 05 May 2021 16:34:15 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39508 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2)
 (envelope-from <ludo@gnu.org>)
 id 1leODn-0006Pc-9Q; Wed, 05 May 2021 16:34:15 -0400
From: Ludovic Courtès <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Subject: Re: bug#48146: Getting diverted to non-updated branches: a
 limitation of the authentication mechanism?
References: <b3c137f53eb256d43267e2358874bd25e4686e32.camel@telenet.be>
Date: Wed, 05 May 2021 22:34:13 +0200
In-Reply-To: <b3c137f53eb256d43267e2358874bd25e4686e32.camel@telenet.be>
 (Maxime Devos's message of "Sat, 01 May 2021 23:40:01 +0200")
Message-ID: <874kfgj4xm.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48146
Cc: 48146@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

>   5. The user is at commit A. There is a correctly-signed commit C on, say, core-updates,
>      such that:  C comes after A, but C is not yet in master for the foreseable future.
>
> Method:
>   6. The attacker subverts savannah, replacing the tip of 'master' with 'C'.
>      To avoid detection, this subverted master is only served to the targetted users.
>   7. The targetted users' systems' unattended-service-type
>      do their equivalent of "guix pull && guix system reconfigure ...".
>   8. The targetted systems are now on core-updates, which does not receive timely
>      security updates.
>   9. On future automatic upgrades, the users' systems will stay on core-updates,
>      without any obvious indication something is wrong.  (Aside from recompilations,
>      maybe the user's machine has 40GiB RAM, dozens of processors and sits in some
>      data centre where the user won't notice the sound of the fans.)
>  10. A vulnerability is discovered (and fixed) and there is a blog post or something!
>      The attacker is late to the party.
>  11. Unfortunately for the user, the automatic upgrade does not fix the vulnerability
>      on the user's system, as vulnerabilities are not patched on core-updates.

Note that the attacker doesn’t even need to do something as
sophisticated as you describe: they can just tweak the repo such that
the advertised tip of ‘master’ remains today’s commit for some time.

The blog post Leo mentioned discusses this problem and it’s not
addressed per se.  If specific users are targeted, as in your scenario,
it could be hard to detect.

But then again, I’d argue it’s beyond our threat model: there are other
ways, possibly easier, to target individuals.

If we assume the attacker is not targeting specific individuals but
rather the whole user base, the attack can still be carried out but it
wouldn’t go undetected for long.  The “reference state log” mentioned in
the blog post could help.

> Proposal for a fix:
>  13. Find a volunteer to actually implement this.
>  14. When creating branches that do not receive timely security updates,
>      such as wip-gnome, core-updates and staging, add a line
>
>      Authentication-Allow-Automatic-Follow: no (core-updates)
>
>      to the commit message.
>  15. When updating guix from a commit A to commit B, additionally verify
>      whether there exists a path from A to B that does _not_ have a 
>
>      Authentication-Allow-Automatic-Follow: no [branch]
>
>      line.  If no such path exists, bail out and tell the user something
>      like:
>
>      error: Refusing to switch to the branch 'branch'!
>
>      This usually means someone is trying to trick you into
>      not receiving timely security updates! Please report this
>      incident to #guix on freenode, or at bug-guix@gnu.org.
>
>      It is safe to simply run "guix pull" again later.
>  16. If there is a path from A to B that _does_ have a 
>
>      Authentication-Allow-Automatic-Follow: no [branch]
>
>      line, and another path that does _not_ have such a line,
>      that means the branch has been merged, which is totally fine,
>      so no error message is required in that case.

It’s an interesting idea.  It addresses the scenario you described
(redirecting users to a different branch) but it doesn’t address the
more general indefinite freeze attack.  I’m not sure it’s worth focusing
on this special case.  Something like the “reference state log” would
help address the general case.

Thoughts?

Thanks for thinking through it!

Ludo’.




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 04:17:39 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.