From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OIIgBwTVaGAu2AAAgWs5BA (envelope-from ) for ; Sat, 03 Apr 2021 22:50:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gMH5AATVaGCECwAA1q6Kng (envelope-from ) for ; Sat, 03 Apr 2021 20:50:12 +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 3AEE915D02 for ; Sat, 3 Apr 2021 22:50:11 +0200 (CEST) Received: from localhost ([::1]:54576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSnDd-0007mp-Sk for larch@yhetil.org; Sat, 03 Apr 2021 16:50:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSnDW-0007mj-Dy for bug-guix@gnu.org; Sat, 03 Apr 2021 16:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSnDW-0006lu-7A for bug-guix@gnu.org; Sat, 03 Apr 2021 16:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lSnDW-0006ue-5q for bug-guix@gnu.org; Sat, 03 Apr 2021 16:50: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 03 Apr 2021 20:50: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: Maxime Devos Received: via spool by 47584-submit@debbugs.gnu.org id=B47584.161748297326532 (code B ref 47584); Sat, 03 Apr 2021 20:50:02 +0000 Received: (at 47584) by debbugs.gnu.org; 3 Apr 2021 20:49:33 +0000 Received: from localhost ([127.0.0.1]:34503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSnD2-0006ts-T8 for submit@debbugs.gnu.org; Sat, 03 Apr 2021 16:49:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSnD1-0006tf-SF for 47584@debbugs.gnu.org; Sat, 03 Apr 2021 16:49:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59420) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSnCw-0006WG-LM; Sat, 03 Apr 2021 16:49:26 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40718 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lSnCw-00078K-0C; Sat, 03 Apr 2021 16:49:26 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <1a6ed722dfdd96dc8d53f939aa8e440ca7c29213.camel@telenet.be> <9c0c5f5906e45e83ecae84ae8858ddaf4ea78569.camel@telenet.be> Date: Sat, 03 Apr 2021 22:49:24 +0200 In-Reply-To: <9c0c5f5906e45e83ecae84ae8858ddaf4ea78569.camel@telenet.be> (Maxime Devos's message of "Sat, 03 Apr 2021 18:26:53 +0200") Message-ID: <878s5zw0tn.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-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=1617483011; 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: content-transfer-encoding:content-transfer-encoding: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; bh=H8ylJ8c+onLdm3W7lceB4Q843g2njhc/M7+ZmsBYwHI=; b=X541vmTPG1BFRxqH0pEU6lHN5roLQbF/03LSka7JXfmXZDaiYThI+d8f5XlpHjJxVLYohx 2kPliO/Zjj0T3csU/P21waLKOnmqtn24qHG0nG5+6EGbfxqZ82jUgzMtkq4hP8nVDl430n ZMUhnvRoLjF9/5Qh/AeWSz1FCYOlhkvxQ6t2h81TH5HMcs6bRmwHv1QSNitv+fHYI2a4hC o22+LNmKChghKJqpigSoR8R5xbSBLUF93a7xQT/g1RxiSrleiolEHpBpZTejkHqwGJxeKR WMmXMBrO/OqRXWNQ8V0xbOA+2CgVt/PlRsR8zDLFZ5AH4qtIuFHfD4tWZ/S8kw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617483011; a=rsa-sha256; cv=none; b=q6Sv5Un5v/NOq2b9HVeWTYZOXkpifYWZTxZnGx8rYzFAJ8kl7dq2u5LWqji7/bj9hgOQpK /v8VVJ3FWrFNqvzh3J6VpVfR8Ra+lyl+ENVdmsPDrM5i5K9Dr7HTsA3GQh9vXJWd+9aE/e Fh0ddmAGiOvHnLPKm85n+sZeQQhZgT7yW6DcWO9TlmJXMOf3f31cZczv6Y2sge9KlzQ5wO vUeiS0ogUVNQ4P6LivOiF4rKJ1ezdhjm0rd/5NCUtGrD8CEUAKMclHxndNbDz3MYhz9Sba +ctcJWgMgwbiujaHi6obFWPh7ypd269bGkPu8qS0zgB88wP6aB/0af6ke9tEUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 3AEE915D02 X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: Gl0a2UfMQfaJ Maxime Devos skribis: > +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. `$HOME/.gdbinit`) and replaces > +it with a symbolic link to a file not owned by the user, such as > +`/etc/shadow`. Also=E2=80=A6 in this paragraph, it=E2=80=99s not entirely clear which use= r we=E2=80=99re talking about it. In news.scm, I reworded it like so: The attack can happen when @command{guix system reconfigure} is running. Running @command{guix system reconfigure} can trigger the creation of new= user accounts if the configuration specifies new accounts. If a user whose ac= count is being created manages to log in after the account has been created but before ``skeleton files'' copied to its home directory have the right ownership, they may, by creating an appropriately-named symbolic link in = the home directory pointing to a sensitive file, such as @file{/etc/shadow}, = get root privileges. It may also be worth mentioning that the user is likely unable to log in at all at that point, as I wrote here: https://issues.guix.gnu.org/47584#6 WDYT? Ludo=E2=80=99.