From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: bug#37744: Per-user profile directory hijack (CVE-2019-17365 for Nix) Date: Wed, 16 Oct 2019 21:58:39 +0200 Message-ID: <20191016215839.73c32b64@sybil.lepiller.eu> References: <87o8yjsr8o.fsf@gnu.org> <87blujsqq0.fsf@gnu.org> <87y2xno85o.fsf@nckx> <87d0eyuqzd.fsf@gnu.org> <87mue2nkrj.fsf@nckx> <8736fttby6.fsf@gnu.org> <87tv89rnva.fsf@gnu.org> <878spksty3.fsf@gnu.org> <20191016142221.qys2y2cb4spmwscq@pelzflorian.localdomain> <87ftjsoh40.fsf@nckx> <20191016151922.5fanqbt6kiv4offx@pelzflorian.localdomain> <87eezcogtf.fsf@nckx> <87ftjsk4d3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37375) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKpRo-0003uT-6T for bug-guix@gnu.org; Wed, 16 Oct 2019 15:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKpRm-0006L0-SI for bug-guix@gnu.org; Wed, 16 Oct 2019 15:59:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKpRm-0006Kh-In for bug-guix@gnu.org; Wed, 16 Oct 2019 15:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iKpRm-0001VO-H7 for bug-guix@gnu.org; Wed, 16 Oct 2019 15:59:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87ftjsk4d3.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 37744@debbugs.gnu.org Le Wed, 16 Oct 2019 19:05:44 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > Hi! >=20 > Thanks for your feedback Tobias, Florian, and Julien! >=20 > Taking that into account, I propose this (I=E2=80=99ve also changed the t= itle > to make it hopefully clearer): >=20 > --8<---------------cut here---------------start------------->8--- > (entry (commit "FIXME") > (title (en "Insecure @file{/var/guix/profiles/per-user} > permissions")) (body > (en "The default user profile, @file{~/.guix-profile}, > points to @file{/var/guix/profiles/per-user/$USER}. Until now, > @file{/var/guix/profiles/per-user} was world-writable, allowing the > @command{guix} command to create the @code{$USER} sub-directory. >=20 > On a multi-user system, this allowed a malicious user to create and > populate that @code{$USER} sub-directory for another user that had > not yet logged in. Since @code{/var/@dots{}/$USER} is in > @code{$PATH}, the target user could end up running attacker-provided > code. See @uref{https://issues.guix.gnu.org/issue/37744} for more > information. >=20 > This is now fixed by letting @command{guix-daemon} create these > directories on behalf of users and removing the world-writable > permissions on @code{per-user}. On multi-user systems, we recommend > updating the daemon now. To do that, run @code{sudo guix pull} if > you're on a foreign distro, or run @code{guix pull && sudo guix > system reconfigure @dots{}} on Guix System. In both cases, make sure > to restart the service afterwards, with @code{herd} or > @code{systemctl}."))) --8<---------------cut > here---------------end--------------->8--- pour le fran=C3=A7ais (n'h=C3=A9site pas =C3=A0 reprendre le texte si tu tr= ouves =C3=A0 redire :)) : titre : Permissions laxistes pour @file{/var/guix/profiles/per-user} corps : Le profil utilisateur par d=C3=A9faut, @file{~/.guix-profile}, pointe vers @file{/var/guix/profiles/per-user/$USER}. Jusqu'=C3=A0 maintenant, @file{/var/guix/profiles/per-user} =C3=A9tait disponible en =C3=A9criture pour tout le monde, ce qui permettait =C3=A0 la commande @command{guix} de cr=C3=A9=C3=A9r le sous-r=C3=A9pertoire @code{$USER}. Sur un syst=C3=A8me multi-utilisateur, cela permet =C3=A0 un utilisateur malveillant de cr=C3=A9er et de remplir le sous-r=C3=A9pertoire @code{USER}= pour n'importe quel utilisateur qui ne s'est jamais connect=C3=A9. Comme @code{/var/@dots{}/$USER} fait partie de @code{$PATH}, l'utilisateur cibl=C3=A9 pouvait ex=C3=A9cuter des programmes fournis par l'attaquant. V= oir @uref{https://issues.guix.gnu.org/issue/37744} pour plus de d=C3=A9tails. Cela est maintenant corrig=C3=A9 en laissant =C3=A0 @command{guix-daemon} l= e soin de cr=C3=A9er ces r=C3=A9pertoire pour le compte des utilisateurs et en supprimant les permissions en =C3=A9criture pour tout le monde sur @code{per-user}. Nous te recommandons de mettre =C3=A0 jour le d=C3=A9mon imm=C3=A9diatement. Pour cela, lance @code{sudo guix pull} si tu es sur une distro externe ou @code{guix pull && sudo guix system reconfigure @dots{}} sur le syst=C3=A8me Guix. Dans tous les cas, assure-toi ensuite de red=C3=A9marrer le service avec @code{herd} ou @code{systemctl}. >=20 > If this is fine with you, I hereby request translation of this entry. > :-) >=20 > I=E2=80=99ll commit the change within a few hours if there are no objecti= ons. >=20 > Ludo=E2=80=99. >=20 >=20 >=20