From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Fqz2LLJsaWBJpAAAgWs5BA (envelope-from ) for ; Sun, 04 Apr 2021 09:37:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WNX3JbJsaWCTDQAAB5/wlQ (envelope-from ) for ; Sun, 04 Apr 2021 07:37:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0EDBD161CA for ; Sun, 4 Apr 2021 09:37:22 +0200 (CEST) Received: from localhost ([::1]:58464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSxJw-0000Se-Nq for larch@yhetil.org; Sun, 04 Apr 2021 03:37:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSxJf-0000EN-7q for bug-guix@gnu.org; Sun, 04 Apr 2021 03:37:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSxJf-0001FC-0Z for bug-guix@gnu.org; Sun, 04 Apr 2021 03:37:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lSxJe-00061u-Uq for bug-guix@gnu.org; Sun, 04 Apr 2021 03:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47584: Race condition in =?UTF-8?Q?=E2=80=98copy-account-skeletons=E2=80=99:?= possible privilege escalation. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 04 Apr 2021 07:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47584 X-GNU-PR-Package: guix X-GNU-PR-Keywords: security patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 47584-submit@debbugs.gnu.org id=B47584.161752179323120 (code B ref 47584); Sun, 04 Apr 2021 07:37:02 +0000 Received: (at 47584) by debbugs.gnu.org; 4 Apr 2021 07:36:33 +0000 Received: from localhost ([127.0.0.1]:34805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSxJB-00060q-6x for submit@debbugs.gnu.org; Sun, 04 Apr 2021 03:36:33 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:46292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSxJ8-00060f-De for 47584@debbugs.gnu.org; Sun, 04 Apr 2021 03:36:31 -0400 Received: from butterfly.local ([213.132.130.22]) by laurent.telenet-ops.be with bizsmtp id oXcT240040V8PTH01XcTjC; Sun, 04 Apr 2021 09:36:28 +0200 Message-ID: <7ab30aad812e5de1216c95b3becb784e3363e615.camel@telenet.be> From: Maxime Devos Date: Sun, 04 Apr 2021 09:36:05 +0200 In-Reply-To: <87mtufw1kh.fsf@gnu.org> References: <1a6ed722dfdd96dc8d53f939aa8e440ca7c29213.camel@telenet.be> <87mtufw1kh.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-GgihR8j2Jc6JXdkG+YPu" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1617521788; bh=szhUwAbkOkCRbakpAFlC5wxskctYFLOMA/DJFceAFZ4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YU9jg1/kGhBqN9Qn+8IIPwEZxApVwS5MyOn0co4KfBE5UPnlQxh/N6gc+v9cYUSke xnzN9wyJoodGai+GpQ+JBcMIRCdNYvUISSzBl4m/rFXghM/LNePu5yg+f2bl7UBBTZ Vd7i8Z4x4fxuAvzOy2PVpvvrVDcs0TSrs8kmgIrEQ4PAyPRb64P8C6wbk0DCJaNtGv MV5JnttCWd9d+ZsaLoVNkNtn7eYEcYpcO6Ih8ola8TA7dJgSQqmU0Zf8x4b3iWAkqG DTQJtTzpmD/yyTmuUJueeOOnncAt8YntEtTOInuDhBfnLNR2RdN0zeUBw2w7UUk8+H U1UeqEj75b1eg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 47584@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617521842; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=szhUwAbkOkCRbakpAFlC5wxskctYFLOMA/DJFceAFZ4=; b=T1gUeOGu4ZVmwy3OpfhB1dmmUrWUYSZcN9j7IQbpAN0S5BMiVHgain6HUc1w9mGYke5XsZ Is1K12oPhI8lhPniEWTzWTmLHK+PXl83f844+8oziWW/gJVrjA+/GQu8CHubq6R1WvjNSM /VysGRXZuRAVeAKxvKZv8aF16Pzu0BaOkpUW54HALBOeYobLJVwBz+moa05E/rJ/htM7Ap IGmGKBIaX5Td4jOBPCsj0HKFsk5WH9vosQkcVKt3O0EgXjh0FXwKj0r0/QlbqqZtJLG2Be yo/e+ywQkr7LOPmOdwWtamy4deE26n9vFOf1jf53HjkRy08BC910dNcmbANnXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617521842; a=rsa-sha256; cv=none; b=KlQuNLwOkE5uhEzlOgtOgvZ7ceEDzc73jnEUzzAV/fAYFq8QsLwMEyxHqf27CgSRQoI/L6 qKUl7PODJ4Q/qYLwtPJr04JGppnCzDkH3DNliFxWnowpekffwjOCbWEIvaOqSTnRQaDR9z EWCHxucAD2/eDTrpU1z/ypFU0DtxBUFnOqthnTVJIPkkE3jSH1l8qr8QnC1z7xh0RbNwst LaiQpRffRTE5z+2e4oyHxJqpddwrz5Y91HzwaUJuEDqOds0r/x0eO9tAjfkc3vxXYFE2t0 GeRvpfRpTOQdcV/eQOSWsU7qZo2A64ll2i0I5SOD47tWUSyP9YE2ZCX3BJlnQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b="YU9jg1/k"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b="YU9jg1/k"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 0EDBD161CA X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: WgF7l+DGjGXf --=-GgihR8j2Jc6JXdkG+YPu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2021-04-03 at 22:33 +0200, Ludovic Court=C3=A8s wrote: > Maxime Devos skribis: >=20 > > The attack consists of the user being logged in after the account > > skeletons have been copied to the home directory, but before the > > owner of the account skeletons have been set. The user then deletes > > a copied account skeleton (e.g. @file{$HOME/.gdbinit}) and replaces > > it with a symbolic link to a file not owned by the user, such as > > @file{/etc/shadow}. > >=20 > > The activation code then changes the ownership > > of the file the symbolic link points to instead of the symbolic > > link itself. At that point, the user has read-write access > > to the target file. >=20 > In the draft blog post, you mention that the attack cannot be carried > out when protected symlinks are enabled. In the blog post, I thought I wrote the attack can be carried out *even if* protected symlinks are enabled. Looking at https://sysctl-explorer.net/fs/protected_symlinks/, I don't think the Linux protected symlink feature helps, as home directories are never sticky and word-writable. Perhaps I should have written =E2=80=98possible=E2=80=99 instead of =E2=80= =98not impossible=E2=80=99 in the blog post. > Please mention that protected symlinks are enabled by default on Guix > System since a March 16th commit, with a link to [...] See my response above. I agree with all other comments on this bug report. Greetings, Maxime. --=-GgihR8j2Jc6JXdkG+YPu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYGlsZRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nfCAQDK+Ax9TJ45aL/KI0IrAe7ViBOR Cchmjv3U/Nfrr73cggEA6DKXJYvn8dc+pKJy8XosAFkl/GwWjcnHHtqH08zp/QM= =UX7H -----END PGP SIGNATURE----- --=-GgihR8j2Jc6JXdkG+YPu--