When Flatpak's Sandbox Cracks

17 dxs 20 8/1/2025, 8:01:53 PM linuxjournal.com ↗

Comments (20)

ChocolateGod · 19m ago
A lot of Flatpak applications ship with filesystem=home, and this is effectively opens up ways of indirectly getting root access (since you can override sudo by editing .bashrc) or overriding .desktop files (of say system settings) to point to your application instead which a user is more likely to enter their password when opening, or override environmental variables, you get the picture.

It's not as if non-Flatpak apps can't do this either, but the false sense of security from Flatpak may encourage people to download apps they wouldn't otherwise.

Unlike Android/iOS where Google/Apple can push developers to update their apps to use new apis, or say bye bye to those that don't, there's no motivation for Linux app devs to update their applications to use portals to avoid the need for filesystem=home, and as long as that exists people will just install them with a false sense of security.

Flatpak is not a security project, it's an app distribution one (which I think it does a generally better job than native packages, but the bar is low). The sandbox should be considered part of the separation from host dependencies, nothing else.

fake-name · 1h ago
Flatpak, Snap, appimage, etc...

I have pretty fastidiously avoided ever using any of the "package everything into the image" projects, and my life has been considerably better off.

All these things serve to do is make the developer experience easier, at the cost of delivering a much worse user experience.

I can't think of any reason a user would ever prefer packaged variant of something.

ChocolateGod · 26m ago
> package everything into the image" projects

But Flatpak does not do this. It consists of runtimes that usually contain the most of what applications needed, and are updated separately from the application itself.

yjftsjthsd-h · 8m ago
Yes, flatpak does do that; its base images only have the basics, leaving apps to bring the rest of their own libraries/dependencies.
jwrallie · 30m ago
It is better when you cannot get a package otherwise, so if you use a distro with a big repo, it happens mostly with proprietary software.
xorcist · 20m ago
Most proprietary software ships as tgz files which you can just unpack and run.

A few ships with "installers", which are mostly just bash scripts with the tgz embedded.

Simple enough.

WesolyKubeczek · 2h ago
Flatpak's "sandbox" is mostly theater, and it gives little when it comes to privacy. Apart from the obvious that packages sometimes come with overly broad permissions to be usable at all (but you are still given a marketing pitch about enhanced safety, granted, flatpak.org doesn't do it but flathub does), the fact that some paths are denied or some access is revoked is also a data point.

I'd like to have a system where I can choose to give any bitmap, movie, or blank screen when an application asks me for permission to use my camera. It shouldn't know that I have denied it. When it asks for my microphone, I should be able to choose to make it think I allowed it microphone access with dummy audio stream with no audio or audio of my choice. When it asks me to open a file, or a directory, it should invoke a system dialog that cannot be faked, and when I pick a file/directory for it, that directory or file should be bind-mounted into its mount namespace without giving it extra information about other files beside it, or indeed what's the full path of the file. When recording a screen, I should be able to pick which regions and which applications it should be able to see, and the system should make it think it's all there is.

All the while the application doesn't even have to cooperate. This is the important bit.

I think the pieces to do this are mostly there already (portals, Pipewire, namespaces), it's just a lot of faff to actually implement.

dylan-m · 38m ago
> When it asks me to open a file, or a directory, it should invoke a system dialog that cannot be faked, and when I pick a file/directory for it, that directory or file should be bind-mounted into its mount namespace without giving it extra information about other files beside it, or indeed what's the full path of the file. When recording a screen, I should be able to pick which regions and which applications it should be able to see, and the system should make it think it's all there is.

You've described exactly what flatpak is doing? I'm curious what gaps you see with its approach in particular.

CaliforniaKarl · 1h ago
That reminds me of something iOS is doing (though I don't know when it was introduced).

An app wanted permission to my photos. In addition to the normal "Allow" and "Deny" options, I was also given the option to allow a subset of photos. I chose that option, and was given the normal photos UI, as if I was selecting a set of photos to share or delete. I guess in the back-end, iOS constructed a new photos library consisting of just the ones I selected.

It was cool! And it's good to see things at least one of the things you describe is being shown to a large number of folks. Hopefully that'll drive momentum to wider adoption.

Modified3019 · 1h ago
I believe this is part of what [Spectrum OS](https://spectrum-os.org/) is ultimately trying to do. That said, while it’s being actively developed, it’s not a trivial effort and is nowhere near “download the iso and daily drive it”.
bestorworse · 2h ago
I want that as well, but I don't think it's practical to do that on the Linux desktop ecosystem. Too slow, too much politics. The gist of it is done by Android though, but that required extensive re-engineering of the user space.

Risking getting down voted but I don't want to repeat myself: https://news.ycombinator.com/item?id=43255985

freedomben · 1h ago
I would love the capabilities you describe, but I don't think it's fair to call flatpak "mostly theater." Yes plenty of flatpak apps require you to broaden their perms to the point where the sandbox starts to feel pretty weak, and there is plenty more to do on the system, but I think it's a good step forward.
AlienRobot · 1h ago
Then it's never going to happen.

Linux desktop is a huge mountain of "why this basic obvious stuff just doesn't work?"

I mean just stop to consider this. It's 2025. You are still not guaranteed to be able to close an application by moving the mouse all the way to the top right and clicking, because sometimes the X button has a margin at the top. This is insane to me. This is like such a basic thing that I have no idea how do you even manage to get it wrong.

If Linux can't even get the X button right, do you seriously expect anything else to ever get fixed?

pstuart · 1h ago
That's a desktop issue, not a linux issue.
AlienRobot · 1h ago
I don't remember installing "desktop" on my computer.