From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wK7GNeDPaGAV0AAAgWs5BA (envelope-from ) for ; Sat, 03 Apr 2021 22:28:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6N0VLuDPaGC4LQAAbx9fmQ (envelope-from ) for ; Sat, 03 Apr 2021 20:28:16 +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 1658282B9 for ; Sat, 3 Apr 2021 22:28:16 +0200 (CEST) Received: from localhost ([::1]:49778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSmsQ-0004h2-Jo for larch@yhetil.org; Sat, 03 Apr 2021 16:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSmsE-0004gq-AW for bug-guix@gnu.org; Sat, 03 Apr 2021 16:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSmsE-0005Mp-3T for bug-guix@gnu.org; Sat, 03 Apr 2021 16:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lSmsD-0006O9-UH for bug-guix@gnu.org; Sat, 03 Apr 2021 16:28:01 -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:28:01 +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.161748165424521 (code B ref 47584); Sat, 03 Apr 2021 20:28:01 +0000 Received: (at 47584) by debbugs.gnu.org; 3 Apr 2021 20:27:34 +0000 Received: from localhost ([127.0.0.1]:34489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSmrm-0006NQ-3i for submit@debbugs.gnu.org; Sat, 03 Apr 2021 16:27:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSmrk-0006NE-GC for 47584@debbugs.gnu.org; Sat, 03 Apr 2021 16:27:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59280) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSmre-00051O-Ac; Sat, 03 Apr 2021 16:27:26 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40574 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lSmrd-0004vc-BL; Sat, 03 Apr 2021 16:27:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <1a6ed722dfdd96dc8d53f939aa8e440ca7c29213.camel@telenet.be> Date: Sat, 03 Apr 2021 22:27:23 +0200 In-Reply-To: <1a6ed722dfdd96dc8d53f939aa8e440ca7c29213.camel@telenet.be> (Maxime Devos's message of "Sat, 03 Apr 2021 18:09:16 +0200") Message-ID: <87sg47w1uc.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=1617481696; 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=ZA+0gfO+QUYK0KhN4uXhaE/1M7uWsIDzgHTebyKKsM4=; b=mjWGYueJx7cU8svKLS6XPmJ+GUFyUuiaRsUJ0CYCe9KOIZLMQj0+AMaYawuiNoqPFUePqo 7D9gwHkULqlUms6NO4H+36xHX0CCjqnVrYceoZvgHpjfDLxborL7Gi3g4VdBqY1PN3rAC+ gp8eHa6/Eqj3EOhrCTJf/EeXGOg0UaD3vD4zIaE4T05qc63Vx6IJzY4QcXbpYQYlGC0ytb SsgLPZRGzLdce77M4COOLxhlL4W6ifExcj7EIsbQIMngxWjYbLbC8Meu5vy6TdTSBNcZrr fpztEd7w6f1HMoeJBUiCnL8rx6D3kpwjUwavbsA3FNONtB2MoaiMv0S+i186ew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617481696; a=rsa-sha256; cv=none; b=ff9s012BoJ0uuVZNkmxPd79q3fSqzyAXxe0306gi4j+pq0JQ1NhPLnd/9/afI59FWXCMY2 lVk6ysKfHwCsEEprEAA90mX3m36h62BC2Eqd0RodLutlVHbRa3oqw/CE3rvYJGdG5jmUcJ p6GXNGswOgT4kVk7jhOcRVJTuH6oO6OJjFwyW52oG1rn03BgDBvDBKYHEBfdGC7CGIXvlN eVPOxaKqv6Y7OTPD2uMBrurtYhIJw1VDLkkyvwUPh+l5QJC4ZIDBcShS1lknSF5hZVtGpb C1T95/iLBeK47nnMnrEv8mEl9lw1IV7SJQg1D3wggji0gd6Zn2Dup0sqzjyrWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: -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: 1658282B9 X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: FwI2n/E/B7xV Note that this issue is about Guix System; users of Guix on other distros are unaffected. 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. @file{$HOME/.gdbinit}) and replaces > it with a symbolic link to a file not owned by the user, such as > @file{/etc/shadow}. > > 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. To give a bit more context, account creation on Guix System happens while =E2=80=98guix system reconfigure=E2=80=99 is running. The user whose account is being created thus needs to be able to log in right during the time window described above. Users whose password is uninitialized (i.e., the =E2=80=98password=E2=80=99= field of is left unspecified=C2=B9) cannot log in at that point, unle= ss possibly if the OpenSSH configuration specifies an authorized key for the user account. Ludo=E2=80=99. =C2=B9 https://guix.gnu.org/manual/en/html_node/User-Accounts.html =C2=B2 https://guix.gnu.org/manual/en/html_node/Networking-Services.html#in= dex-openssh_002dservice_002dtype