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 OC0fDV1ra2D2WwAAgWs5BA (envelope-from ) for ; Mon, 05 Apr 2021 21:56:13 +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 qLEcB11ra2BBcgAA1q6Kng (envelope-from ) for ; Mon, 05 Apr 2021 19:56:13 +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 78E321109D for ; Mon, 5 Apr 2021 21:56:12 +0200 (CEST) Received: from localhost ([::1]:57962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTVKU-0005FR-E1 for larch@yhetil.org; Mon, 05 Apr 2021 15:56:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTVKM-0005EZ-G4 for bug-guix@gnu.org; Mon, 05 Apr 2021 15:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTVKM-0003NM-8P for bug-guix@gnu.org; Mon, 05 Apr 2021 15:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTVKM-0003aI-6v for bug-guix@gnu.org; Mon, 05 Apr 2021 15:56: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: Mon, 05 Apr 2021 19:56: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.161765254213748 (code B ref 47584); Mon, 05 Apr 2021 19:56:02 +0000 Received: (at 47584) by debbugs.gnu.org; 5 Apr 2021 19:55:42 +0000 Received: from localhost ([127.0.0.1]:38637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTVK2-0003Zf-8F for submit@debbugs.gnu.org; Mon, 05 Apr 2021 15:55:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTVK0-0003ZQ-70 for 47584@debbugs.gnu.org; Mon, 05 Apr 2021 15:55:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36383) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTVJs-00038g-IC; Mon, 05 Apr 2021 15:55:34 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=46782 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lTVJJ-0002gb-Gt; Mon, 05 Apr 2021 15:55:05 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <1a6ed722dfdd96dc8d53f939aa8e440ca7c29213.camel@telenet.be> <87mtufw1kh.fsf@gnu.org> <7ab30aad812e5de1216c95b3becb784e3363e615.camel@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Germinal an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 05 Apr 2021 21:54:56 +0200 In-Reply-To: <7ab30aad812e5de1216c95b3becb784e3363e615.camel@telenet.be> (Maxime Devos's message of "Sun, 04 Apr 2021 09:36:05 +0200") Message-ID: <87zgycqzfz.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=1617652572; 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=m/RSwYXM8KmN7l426SrI+LgG1iw1KvyUayJJ5pmBU9o=; b=EZ8aB6iP76iuh4u0OE/rjTFiO7vXYmlSzmaFz5Kdfw0TDW8iFnSSj7pmGL7Fz63SnfD4p/ Ql7gYnMO0kfSsMV7nbEiF3D/4J7JvmT9jQQdE9tzSw4ViD80itzgmpHtDLi9YIyxJGYHtp GOfDkZuU81JeCTMp4ahciFeOwiwZI+zdnG57wI7DuXF9b8Im6JcT2OgpRMDYl5zPAAWpLM IuLyAH9Y4xNrn+ZwkDz+NPpWAOYbyqmaB5OpKr7wz3VUW5nfAYXis94LkYqumTMl9h3599 7uolJJf4hlkdO+tTIdBkLD2puy0zNSI+nRofyD65ug2/kDXLvlzVrCWkDn5mPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617652572; a=rsa-sha256; cv=none; b=qWmkMqB0V1Ae+th1GKy+Je6ROdfwwEI6g5x7bCkQXootJeEsCSgZuNj8sL3eROYbL97GiK a3tps+MofW8Ms7sY49jCR7fUCWeMZYp+p7yJRsphT9xU4xLrnCCEZoWWkaYBYs1xaASEf1 usrdVzNrx8B1EHCabQCDLztN+TyjhXQdc91eZC4AB7H8+drwPIoH7StgUXciAV+YZX7BG8 CK0KEDDm1tc7Rk6HGCqRLclYiDgz6jpy2a//AOwkk9CM0zTn/eIjrivVTzdAXoxlKpBSYD AGWObh4NEsmkSLxKQVtsFwYz2c4OBUgZF6YBJkm6FI5tCQ1I2uJhHbAReqczZw== 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.94 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: 78E321109D X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: MoYfKsPit2gE Hi Maxime, Maxime Devos skribis: > 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. Oh right, my bad, I overlooked this. > Perhaps I should have written =E2=80=98possible=E2=80=99 instead of =E2= =80=98not impossible=E2=80=99 > in the blog post. Dunno, maybe it=E2=80=99s just me not paying enough attention. > I agree with all other comments on this bug report. OK. It does mean that the bug is hardly exploitable in practice: you have to be able to log in at all, and if you=E2=80=99re able to log in, you= have to log in precisely within the 1s (or less) that follows account creation, which sounds challenging (TCP + SSH connection establishment is likely to take as much time or more, likewise for typing in your password.) It=E2=80=99s also one-time chance. Do I get it right? Does it warrant as strong messaging as for the recent daemon =E2=80=98--keep-failed=E2=80=99 vulnerability? Thanks, Ludo=E2=80=99.