Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3058739lqt; Tue, 23 Apr 2024 09:14:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXv/PBy46p0s8EUG3XpMqK0V2jqGa9ojMTfC3Ucz7l9eGbKnU7Xj24jsgzYafOPu3rDM7AaRmocHMH3zLQl7+mU5bKEI0gSZJj6WZyoSQ== X-Google-Smtp-Source: AGHT+IHv+qnS5sl2xTK+Mm8L5JPiIhkmsiLPstwaxdhM9Cl3H+v4S8jYbSeaMBgGuL60513QIdGB X-Received: by 2002:a50:9318:0:b0:56d:f7ce:e879 with SMTP id m24-20020a509318000000b0056df7cee879mr9777195eda.37.1713888861119; Tue, 23 Apr 2024 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713888861; cv=none; d=google.com; s=arc-20160816; b=N9XiAd+05tfh/6nqAvIN6OVmnr1gzXm3dFq6IFAi5AOvdSPZ/FG/ysVHMQFsrGhnSI xZQTZyaml9YB1HkBmUZLVNuNw1UZp1MJjN+zIgBnhyBtT1exaJ52NmI92LV7WqTL8QdM 3tk+CI9G/41RsstDO7PnXF+wTVdDP4yMrhZPgsT1dCOfmGjwwg9ZlRugvLMZroppBl+l tZ6HmwYa2bQQWGqKsr3WPs35gnmistAtBAVKySC6CqWDZ27h9ZZDxu9TgQLar3Qj+CE7 uC8FmxZcMQXJNIqWrq7pIhOV/xHXzpGQXFcrAl6QD89TBNyLWBEhuiiShAbKQNqv7GZu GI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:to:from:date:dkim-signature :delivered-to:reply-to:list-id:list-subscribe:list-unsubscribe :list-help:list-post:precedence:mailing-list; bh=/i7LJwUjC/wBJFLaPZeCzZoJa+g+D2grjjzda66Pimk=; fh=9jsPTyo6edd9xvAeG+KFFrRrXMmgB/RdwUKOrvy9dcA=; b=l5nTuOL8xYsR8tmJBJoJtT3r+j7hto3IY/kMwUSc/V+hhRZ/k2mIhoEU8fdkH5QlDp ZBTSjpLgzh/ZL9SrIXpWoYHuAnPbsLLvyZPXxK3042ImngwmNgROimjwoep5F3WmWx4u sLE2E7yKXr9g+0O547cKZOaxInbRKYtbJHAJA21FinWsKVtqsGAtI7KzxLrGOgyGsLqt 4WDDcXqC+tjDhPrAwcuoWkocu1y8rQW6vuAzPjkFJu2BmMr9V7QOQCJWDfN+76pTTE8e HwgMu40CIu+eHMWVQi6pscVA9a2XpKajM6Rfxyy02gkrH5h0Q7gq3A6lihfVS5lrLxkE 96hw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@debian.org header.s=smtpauto.stravinsky header.b=Ncpyo3GE; spf=pass (google.com: domain of oss-security-return-30078-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) smtp.mailfrom="oss-security-return-30078-linux.lists.archive=gmail.com@lists.openwall.com" Return-Path: Received: from second.openwall.net (second.openwall.net. [193.110.157.125]) by mx.google.com with SMTP id i3-20020a508703000000b0056fde9c51easi7458567edb.459.2024.04.23.09.14.20 for ; Tue, 23 Apr 2024 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of oss-security-return-30078-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) client-ip=193.110.157.125; Authentication-Results: mx.google.com; dkim=fail header.i=@debian.org header.s=smtpauto.stravinsky header.b=Ncpyo3GE; spf=pass (google.com: domain of oss-security-return-30078-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) smtp.mailfrom="oss-security-return-30078-linux.lists.archive=gmail.com@lists.openwall.com" Received: (qmail 25982 invoked by uid 550); 23 Apr 2024 16:14:02 -0000 Mailing-List: contact oss-security-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: oss-security@lists.openwall.com Delivered-To: mailing list oss-security@lists.openwall.com Received: (qmail 25958 invoked from network); 23 Apr 2024 16:14:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To :Cc:Content-ID:Content-Description; bh=/i7LJwUjC/wBJFLaPZeCzZoJa+g+D2grjjzda66Pimk=; b=Ncpyo3GEKHnaiw4tTorU37jKfT on6Aj7IsfzeGsXLQLr+h6aAJzsWeFzoME94s2YbRvxDL3ebZ/MUoUo9iEMmLrg5/3LOaDUkWk58Re gUMnXTe0fPJ9wotwQ9vM6frLzxILFHaGLbjXc2rvlr9UQzE7Jfowj9kduM30kHvc1g+BS0HDmzIxE uquse2K91ruQBiJh5fHsIPR0uhpqzzAiDsNTA6xMctTvdcxeXRWrfOWtCKVYSmhsDTojo2qYqvKzZ /72UrtVhw9wPgknpHcvDYObKKIdbEPzJymFglUgUtRpglDWuxNbidBGJeb0su0RlH0zNnv9tnVp4p 3ESK9M/A==; Date: Tue, 23 Apr 2024 17:13:50 +0100 From: Simon McVittie To: oss-security@lists.openwall.com Message-ID: References: <20240414190855.GA12716@openwall.com> <354b913bc1c154c1e3a2fc34ed8ed6b0d4641f11.camel@canonical.com> <20240419154435.GA7046@openwall.com> <20240420181211.GA12463@openwall.com> <20240421200625.GA16869@openwall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Debian-User: smcv Subject: Re: [oss-security] Linux: Disabling network namespaces On Mon, 22 Apr 2024 at 18:10:27 -0400, Demi Marie Obenour wrote: > Why is the appid read from /.flatpak-info, instead of having the flatpak > process that spawned the container pass the info to the dbus proxy along > with the FD used to communicate with the container? I didn't design this mechanism, so I can't say anything authoritative about the motivations of its initial designer. (I would appreciate it if this thread can avoid being derailed into asking me "why can't you just?" about design decisions that were already made, by people who weren't me.) Some factors that may have been relevant: D-Bus is not the only AF_UNIX-based protocol that can be used by sandboxed apps to communicate with peers outside the sandbox: some others (subject to suitable --socket and --filesystem permissions) include X11, Wayland, PulseAudio, Pipewire, or in principle anything that exposes an AF_UNIX socket in a well-known location. D-Bus is the only one of these that currently uses a proxy. The fact that a D-Bus proxy is necessary is not ideal, and ideally the message bus would be able to do the firewall-like filtering of messages itself (subject to Someoneā„¢ having enough time to design and implement that, of course). If the design of Flatpak's interactions with portals via D-Bus "baked in" an assumption that there will always be a trusted proxy in the middle, which could be asked for more information about the connection, then that would prevent us from being able to replace the proxy with a suitably enhanced message bus at some point in the future. There is already no D-Bus proxy used if the app has been given direct access to the session bus - which makes that particular app effectively non-sandboxed and part of the trusted computing base, so it would be Very Bad for such an app to be compromised or malicious, but it's still desirable to be able to query the identity of those apps in the same way we would for an app that has been effectively sandboxed. As discussed in this thread, creating new namespaces is a relatively scary attack surface to be giving to the sort of semi-trusted apps that you would typically want to sandbox with Flatpak, so even if the integrity of /.flatpak-info wasn't being used as a security property, we would probably still want to deny that ability to most Flatpak apps anyway (on the same basis that Flatpak already uses seccomp to prevent various more obscure or large-attack-surface syscalls by most sandboxed apps, for example denying ptrace unless the app has --allow=devel, even though in principle allowing ptrace "should" be safe). smcv