News for hackers. Stuff that matters.
Re:Flatpak – a security nightmare – 2 years later (2020) by gspr on Sunday March 21, 2021 @04:38AM (#26529009)
It's almost as if the people riding the "sandbox everything" wave have realized that an operating system is more than a set of disconnected pieces of software. And that to make it an operating system, those pieces must interact, and not be isolated from each other. Go figure.

Soon they'll reinvent the classical Linux distro. Poorly. But with a cool name.

Re:Flatpak – a security nightmare – 2 years later (2020) by higerordermap on Sunday March 21, 2021 @05:37AM (#26529254)
The technological ludditism is exhausting.

We know some things are *objectively* better than the status quo. With attack surface as big as a modern browser or media player, not having sandboxing would be a mistake.

Just the people who are stuck to 1970's way of doing things and fear new things oppose sandboxing.

Re:Flatpak – a security nightmare – 2 years later (2020) by Jouvence on Sunday March 21, 2021 @06:12AM (#26529372)
Sandboxing is fine, but it sounds like Snaps/Flatpaks don't actually do it because that would be too hard - so what's the point?

I get that some packages do actually have sandboxing, but unless it is mandatory and enforced I feel like I'm better off avoiding the ecosystem entirely and dealing with app isolation myself, using containers or VMs.

Re:Flatpak – a security nightmare – 2 years later (2020) by viraptor on Sunday March 21, 2021 @09:06AM (#26530092)
Snap/Flatpak are not doing it because that's not the layer which "does it". They provide the framework which allows since sandboxing today and will provide better sandboxing tomorrow. It's up to the app distributors to support it or not. We won't get full support immediately either.

It may be too hard today. But that's less "Flatpak is a security nightmare" and more "we're not using the features we have very well yet". I feel like some people expected 100% targeted profile for each app or will declare sandboxing a failure. This stuff will take years.

Re:Flatpak – a security nightmare – 2 years later (2020) by als0 on Sunday March 21, 2021 @04:18PM (#26533582)
On average, I've found Snaps to be better sandboxed. But there are plenty of things to dislike about Snap e.g. not respecting XDG base directory spec, persistent daemon running as root, requiring sudo, unable to control when it decides to autoupdate, coarse grain "connection" system ...and more. A lot of obvious design mistakes that don't get fixed for one reason or another.
Re:Flatpak – a security nightmare – 2 years later (2020) by blacksmith_tb on Sunday March 21, 2021 @04:43PM (#26533807)
Well, they are also marketed as a way of isolating dependencies, which they do actually manage to some degree. So they could be weak security-wise without being completely pointless?
Re:Flatpak – a security nightmare – 2 years later (2020) by kabdib on Sunday March 21, 2021 @12:55PM (#26531818)
I dislike sandboxes that

- have complicated permissions that users misunderstand or can be tricked into misconfiguring through inattention, misleading user interface or fatigue

- aren't actually sandboxes because the isolation they claim isn't actually achieved (I usually call these "security holes")

- are used to artificially force markets (e.g., Microsoft's UWP)

Other than that, they're great.

Signed, cranky, pre-morning-coffee programmer speaking ex cathedra from the 1970s

Re:Flatpak – a security nightmare – 2 years later (2020) by higerordermap on Monday March 22, 2021 @01:31AM (#26537139)
I think this is a valid criticism from flatpak / snap. But they are step in right direction about sandboxing (on the other hand bloat and developer trust are main problems abou these platforms for me).
Re:Flatpak – a security nightmare – 2 years later (2020) by gspr on Sunday March 21, 2021 @09:04AM (#26530076)
> We know some things are objectively better than the status quo. With attack surface as big as a modern browser or media player, not having sandboxing would be a mistake.

Absolutely. That's why the comment that makes you characterize me as a luddite explicitly referred to the "sandbox everything wave".

Sandboxing has its place. Sandboxing everything (i.e. the "Flatpak way") is what I'm commenting on.

Re:Flatpak – a security nightmare – 2 years later (2020) by danShumway on Sunday March 21, 2021 @12:36PM (#26531649)
I think that GP's point still stands. Application security on most native platforms right now is a disaster. But application security on Linux is a dumpster fire. Yes, there are ways to do it better with SELinux, yes there are ways to isolate apps, but they're overcomplicated, inaccessible, and the end result is that most consumers don't use them.

Flatpak, for all of its many faults (and there are a lot of them), is still a strict improvement over the current security model running on most desktop Linux computers. Sandboxing native applications (even partially sandboxing them) is objectively better than the status quo.

It is embarrassing that the Linux community is still having this debate. It is exhausting, it feels like the community has to be dragged kicking and screaming away from a 20-year old security model that every other platform has moved on from.

Re:Flatpak – a security nightmare – 2 years later (2020) by fao_ on Sunday March 21, 2021 @02:24PM (#26532608)
Except Multics, which predates UNIX, already had a lot of these features but better.

https://www.acsac.org/2002/papers/classic-multics.pdf

I don't understand how you can honestly, truly say it's "technological ludditism" when it's clear that nobody in this thread is opposing the features that Flatpack and Snap claim to have, which in many forms predate UNIX and predate Flatpack/Snap -- they are just opposing the half-baked implementation that Flatpack/Snap have created.

Re:Flatpak – a security nightmare – 2 years later (2020) by candiodari on Sunday March 21, 2021 @11:37AM (#26531214)
So you think that disallowing access to word processor files to zip and unzip, or backup utilities, or ... is a perfectly reasonable way of doing things?

Because that's what we do on the web. Every app only has access to it's own files and 10 or so standard clipboard formats (and ONLY through the clipboard).

Re:Flatpak – a security nightmare – 2 years later (2020) by danShumway on Sunday March 21, 2021 @12:51PM (#26531782)
Having a portal that dictates file access would be a perfectly reasonable way of doing things, and that's the direction that Flatpak security is at least starting to move in.

There are security models that allow sharing files that don't give direct access to the entire filesystem. A word processor might need access to my Documents folder, but I might choose not to give it access to anything outside of that folder. Or I might choose to tell it it's been given access to a Documents folder, but really it has access to a VFS mount that is a composite of several folders inside of Documents including some shared folders outside of Documents.

This kind of "portal" idea is incidentally also what browser manufacturers are considering as they start to explore offering native file access[0] (although this is obviously an area that in browsers needs to be approached with a lot of caution). I don't think Google's proposal is the best way to handle this, I think it could be better. But it's still better than what's happening on desktops with native apps.

[0]: https://web.dev/file-system-access/

Re:Flatpak – a security nightmare – 2 years later (2020) by benibela on Sunday March 21, 2021 @09:01AM (#26530064)
I have run the browser on a separate user account for years
Re:Flatpak – a security nightmare – 2 years later (2020) by ohazi on Sunday March 21, 2021 @01:35PM (#26532176)
I don't understand why this isn't more popular.

This has been the sandboxing method or choice since the 70s. Filesystem permissions were designed around users and groups, and now everybody's trying to bolt on intra-user access control lists and wondering why the experience sucks so much.

Create a `browser` user. Add yourself to the `browser` group. Maybe give `browser` read access to an area in your docs folder for convenience. Modify your browser launch script. Done.

Re:Flatpak – a security nightmare – 2 years later (2020) by benibela on Sunday March 21, 2021 @06:05PM (#26534576)
I have a few problems.

In the default settings other users could not access the X server. I forgot how that is changed. I changed it once and now just copy the config

Biggest is getting the sound to work. Pulseaudio in system mode should do it. Although it is not recommended to use. And now my headphones do not work reliable anymore. Not sure if it is caused by system mode or by another setting.

And sharing files. Good that the browser cannot change my files, but it works both ways. My normal user cannot change the browser files, sometimes not even access the downloads.

Re:Flatpak – a security nightmare – 2 years later (2020) by still_grokking on Sunday March 21, 2021 @08:17AM (#26529867)
> The technological ludditism is exhausting.

That sounds funny given the facts about Flatpak.

Re:Flatpak – a security nightmare – 2 years later (2020) by mdoms on Sunday March 21, 2021 @02:50PM (#26532834)
Calling opinions you disagree with "exhausting" is exhausting. And obnoxious.
Re:Flatpak – a security nightmare – 2 years later (2020) by Ar-Curunir on Sunday March 21, 2021 @05:01AM (#26529109)
The problem with existing OSes is that they do not offer any restrictions on how the pieces can interact. There’s no well defined API or principles.
Re:Flatpak – a security nightmare – 2 years later (2020) by Pxtl on Sunday March 21, 2021 @12:15PM (#26531477)
This. I would expect a modern permissions model to be:

App has access to its own config/cache folders, and is implicitly and temporarily granted access to a file or directory on a process-lifespan basis when that file or dir is fed to that app through the file browser or through the application's "open file" file dialog box.

Possibly something more liberal could be granted for read permissions for like a gallery app or a music library thing, but that's what I'd expect for write permissions.

Re:Flatpak – a security nightmare – 2 years later (2020) by pcr910303 on Sunday March 21, 2021 @12:35PM (#26531638)
> temporarily granted access to a file or directory on a process-lifespan basis when that file or dir is fed to that app through the file browser or through the application's "open file" file dialog box.

I’m not sure if it’s temporary or process-lifespan basis, but AFAIK macOS’s sandbox does have a model where the user must grant access by using the system-provided out-of-process file dialog for the application to be able to access the files.

Pretty interesting. For an example, try renaming a file in MS Words by clicking on the document icon — you’ll see MS office asking for permission for the access of the parent directory. (Apple does provide rename functionality by it’s APIs, but MS Word does it by it’s own, which requires the permission.)

Re:Flatpak – a security nightmare – 2 years later (2020) by gspr on Sunday March 21, 2021 @10:06AM (#26530550)
Not saying it's perfect, but sure there is! https://en.wikipedia.org/wiki/POSIX for example.
Re:Flatpak – a security nightmare – 2 years later (2020) by spicybright on Sunday March 21, 2021 @01:05PM (#26531903)
Definitely not perfect, but I wish people would lean on good old fashion unix more for these things instead of implementing it worse on top of it.

I skimmed the article and it looks like one thing they do is have a daemon in the background to intercept data in and out, when they could just make user groups and normal file permissions.

I know it's almost a meme at this point, but plan9 had a great system for this.

You were able to define a filesystem layered on top of your own, exposing and linking files/folders however you please to any process.

So say you have a web server. You can make a layer that only has /www and /configs, linked to some folder in /var/foo/webstuff, and /etc/fooserver/configs or something.

No reason why you couldn't standardize an interface for systems like flatpak to safely use your filesystem.

Re:Flatpak – a security nightmare – 2 years later (2020) by Blikkentrekker on Sunday March 21, 2021 @10:10AM (#26530584)
That is because it turns out that everyday software often needs such permissions to operate gracefully.

What is wanted is some system that allows one to run untrusted sofware in without fear of it compromising one's system. — the problem is that the set of software that can be so ran is smaller than expected, as most software by design is capable of making changes to one's system, as one typically uses software for such tasks.

A text editor that cannot edit every file in one's home directory would be rather useless, but in doing so, it is of course capable of completely destroying one's system as well.

The dream of being able to run “entrusted software” is not a very realistic one.

Re:Flatpak – a security nightmare – 2 years later (2020) by eeZah7Ux on Sunday March 21, 2021 @05:25AM (#26529202)
> Soon they'll reinvent the classical Linux distro

Spot on. Distros exists for good reasons: you need someone to configure things to work well together and manage security for you.

Including sandboxing: it's being already done with system daemons by systemd and for applications by firejail and similar.

Re:Flatpak – a security nightmare – 2 years later (2020) by orf on Sunday March 21, 2021 @04:42AM (#26529023)
The “classical Linux disto” got us into this mess, so I doubt it.
Re:Flatpak – a security nightmare – 2 years later (2020) by cl3misch on Sunday March 21, 2021 @05:04AM (#26529121)
No, I think what got us into this mess is Ubuntu being a server distro with a standard release cycle (as opposed to rolling release) getting incredibly popular on desktops.

Desktop users want the newest version of their UI apps and don't care so much about stability. Ideally, the developers of e.g. Inkscape would offer the newest version on each Ubuntu version via apt, but that does not seem to be feasible.

I am no Arch user myself, but I think a rolling release is much more suitable for desktop use. I don't have the feeling most people use Snap/Flatpack for their sandbox, but much rather for getting a new version of some software.

Re:Flatpak – a security nightmare – 2 years later (2020) by necovek on Sunday March 21, 2021 @05:24AM (#26529193)
That would be quite surprising since Ubuntu Server appeared only after Ubuntu Desktop was already the #1 desktop Linux distribution (free CDs shipped worldwide, etc).

Canonical started developing sandboxed packages for Ubuntu phones ("click" packages which evolved into "snap" packages). At about the same time, Canonical was interested in getting other big distributions (RedHat, Suse...) to align on what software (kernel, glibc, GNOME, KDE...) to offer LTS on together, but there wasn't too big of an interest from other distributions (and tbh, I think that's a good thing: upstream open source projects would be strong-armed into caring about only a few versions that monopolist distros decided to base their LTSes on).

It is my guess that Canonical has (post-phones) invested in snaps to reduce the burden of maintaining the desktop and trying to earn some money in the process through the Snap Store. Flatpak seems to be Red Hat's slightly more open response that quickly followed.

The only benefit of Snaps/Flatpak for delivering newer versions of apps over just simply statically compiling everything into an app is that some of the things are shared between snaps (like frameworks, glibc...). You still get all of the same problems (theming, fonts,...).

Re:Flatpak – a security nightmare – 2 years later (2020) by jcelerier on Sunday March 21, 2021 @05:28AM (#26529209)
> I don't have the feeling most people use Snap/Flatpack for their sandbox, but much rather for getting a new version of some software.

That's the case for everyone I know (though they mostly use appimages)

Re:Flatpak – a security nightmare – 2 years later (2020) by viraptor on Sunday March 21, 2021 @09:10AM (#26530110)
> Desktop users want the newest version of their UI apps and don't care so much about stability.

[Citation needed]. Can you imagine telling this to someone who is about to present on a conference call, but zoom updated automatically and fails to start now?

Re:Flatpak – a security nightmare – 2 years later (2020) by ben509 on Sunday March 21, 2021 @11:46AM (#26531278)
If you define "care" as in, "random updates cause enough instability that they make alternate OS's favorable for accomplishing the same tasks," I'd cite Windows autoupdate as fairly hard evidence that people don't care.

I imagine MS has crunched the numbers at some point, and decided that the amount of lost work and interruptions due to forcible updates (especially contrasted with the benefits of updates) is not causing a significant number of people to ditch their OS for a competitor.

Re:Flatpak – a security nightmare – 2 years later (2020) by hobs on Sunday March 21, 2021 @12:00PM (#26531365)
Competitor? Windows is still >85% of desktop use or thereabouts - you can buy an expensive mac or you can go to hell and try out linux; neither is really an alternative for many so they just accept what happens.
Re:Flatpak – a security nightmare – 2 years later (2020) by ben509 on Thursday March 25, 2021 @12:41AM (#26576666)
So why do they bother adding new features to Windows?

I'll answer my question: Companies make decisions on the margin. They don't care that they have 85% of the market. They want that next percentage point.

The users who might switch to or from competitors are precisely the "swing voters" they have to consider.

Re:Flatpak – a security nightmare – 2 years later (2020) by pjmlp on Sunday March 21, 2021 @05:08AM (#26529141)
The people riding the sandbox everything have experience with platforms that are way beyond what GNU/Linux is capable of.
Re:Flatpak – a security nightmare – 2 years later (2020) by owaislone on Sunday March 21, 2021 @02:20PM (#26532569)
Sandboxing does not mean no interaction. It means supervised interaction between apps where the user is in control of what to allow and what not. I'm not sure how well Flatpack does it (never used it) or Snap does it (used quite a bit but never tested how well it sandboxes) but there are other platforms that handle sandboxing pretty well and then provide APIs on top to allow interaction with the system and other apps (iOS, Android, Meego for example).