Determine what to do with existing /.flatpak-info behaviour
#21
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flatpak currently places a file at
/.flatpak-infoin each container's mount namespace, in a way which makes it impossible for confined processes to manipulate the contents or existence of this file.This does not appear to be documented as a security feature (correct me if I am wrong). However, many well-known programs access it through
proc_pid_root(5)to authenticate applications connecting through a directly exposed UNIX socket. This has several issues:proc_pid_root(5)symbolic link is guarded behindPTRACE_MODE_READ_FSCREDS, making it inaccessible across UIDs, and therefore incompatible with hakurei's UID isolation./.flatpak-infosupposedly provides. Flatpak's workaround for this is to disallow namespace creation entirely and instead expose partial namespace functionality over dbus. This is unacceptable as it allows the privileged side of the sandbox tool to accept untrusted user input. It also significantly limits functionality and requires extensive patching or (arguably quite hacky) workarounds, all of which introduce additional code, contributing to the already significantly enlarged attack surface on both sides of the sandbox.Some examples of this behaviour:
These programs always run in a less confined context than the application initial process, enabling confused deputy attacks in all of the above cases.
Notably, most Wayland servers do not suffer from this flaw, as they implement the security context protocol, allowing clients to connect through hakurei. PipeWire eventually requires a proxy regardless of this behaviour, as it offers very little security when directly exposed to the container. And finally,
xdg-desktop-portalwas never useful to begin with, as many of its design choices make it fundamentally incompatible with UID isolation, and some others make it inherently flatpak-specific. A workaround is not required in this case since an entirely new system is required anyway.This ticket aims to keep track of all known instances of this behaviour, determine what we can do about it, and what we can contribute back to the wider community.