Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZifePjN07o_wqYIC@remnant.pseudorandom.co.uk>
Date: Tue, 23 Apr 2024 17:13:50 +0100
From: Simon McVittie <smcv@...ian.org>
To: oss-security@...ts.openwall.com
Subject: Re: 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

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.