Remix.run Logo
▲ josh3736 31 minutes ago

In short, https://xkcd.com/1200/

The desktop security model was designed in the 70s, when the biggest concerns were:

1. Protecting the system itself from its users, and

2. Protecting users from each other.

The need to protect one app from another wasn't a concern in the slightest, because basically all software was trustworthy, and even if it wasn't, there wasn't much to be gained for malware developers other than notoriety. So security was designed around making sure you couldn't break the system or mess with someone else's files (since you shared one machine with potentially thousands of other people).

Fast forward to today, and the latter is irrelevant (machines are rarely shared, especially outside your own family). The former is still somewhat of a concern, but mostly to prevent accidental damage, and manifests as "run this as administrator?" dialogs.

So we're left with every app running under the same user account (the one you use to sign in to your computer). By definition, that account has full access to all of your data (ie, ~/*), and every app you run inherits those permissions.

Your browser has to store its data (including cookies, session state, tokens, etc) somewhere it can read and write, which means somewhere your computer user account can read and write. But of course, that means that any other app you run can also read that data. Browsers do encrypt their cookie jar, but that just punts the problem a bit: the encryption key still needs to be saved somewhere the browser can access, which means other software running as you can access the key too. eg https://www.npmjs.com/package/chrome-cookies-secure

Apple has tried to paper over this situation on Macs by layering additional app-level permissions on top of the traditional UNIX security model, but it's leaky at best, and for power user tools to do anything useful, they end up needing the wide-ranging permissions discussed here — even if the tool only needs a small subset of that access.

This was fixed on mobile OSes by running every single app under its own UNIX user account so that the kernel can properly enforce separation between apps. This is far more effective, but also far more restrictive.