News for hackers. Stuff that matters.
Re:Sandboxed Mac apps can record screen any time without you... by fouc on Saturday February 10, 2018 @08:06PM (#16350570)
Are we ever going to end up with the practice of running every app in their own independent VM?

Should anything at all run in the host OS?

The advantage of running every app in their own VM means that apps won't get necessarily tossed to the side in this constant arms race of upgrades, especially for apps that don't need internet. Imagine still actively using several perfectly good apps that were last updated 10 or 20 years ago?

Re:Sandboxed Mac apps can record screen any time without you... by amelius on Saturday February 10, 2018 @08:48PM (#16350713)
> Should anything at all run in the host OS?

Isn't that equivalent to saying that the set of available kernel calls should be more restricted?

(User mode is a kind of sandbox, after all)

Re:Sandboxed Mac apps can record screen any time without you... by globuous on Saturday February 10, 2018 @11:31PM (#16351205)
It is my understanding that that's what Flatpak is trying to do: "One of Flatpak’s main goals is to increase the security of desktop systems by isolating applications from one another. [...] Limited syscalls. For instance, apps can’t use nonstandard network socket types or ptrace other processes. " [0]

But as my other comment mentions [1], I wish I had the knowledge required to understand the meaning / implications of Flatpak apps. Please let me know if I'm misunderstanding :)

Happy Saturday night y'all !

[0] http://docs.flatpak.org/en/latest/working-with-the-sandbox.h... [1] https://news.ycombinator.com/item?id=16351192

Re:Sandboxed Mac apps can record screen any time without you... by koolba on Saturday February 10, 2018 @10:37PM (#16351036)
Not just the set of kernel calls but the scope of the calls themselves. A text editor should be able to fopen the file I’m editing but it doesn’t need to be able to access ~/Documents/top-secret.txt. You can do this type of thing with SELinux though I’ve yet to see it done in a user friendly way.
Re:Sandboxed Mac apps can record screen any time without you... by tzahola on Sunday February 11, 2018 @09:32AM (#16352820)
You’re looking for capability-based systems.
Re:Sandboxed Mac apps can record screen any time without you... by zanny on Sunday February 11, 2018 @12:30AM (#16351346)
A lot of the motivations to develop and push for Wayland are around security and privacy. An X window, or just more generally any program running on a computer with an X session and either the same privilege or greater than the user running it can view anything on that screen, send any combination of inputs it wants or steal the pointer / keyboard indefinitely.

At the end of the day people don't care about security that much. Wayland is still getting there. Its getting better, particularly in the last year, but its not a huge priority for many people so it has taken upwards of ten years to become usable.

Re:Sandboxed Mac apps can record screen any time without you... by danieldk on Sunday February 11, 2018 @01:46AM (#16351525)
At the end of the day people don't care about security that much. Wayland is still getting there. Its getting better, particularly in the last year, but its not a huge priority for many people so it has taken upwards of ten years to become usable.

I think many people are also not aware of how bad X11 security is. The other day I mentioned that X11 applications can read all keystrokes to someone who does system administration/security at an ISP. To my big surprise, he was not aware of this. (Didn't everyone play with xev at some point?)

On Linux, I only use Wayland because of X11's broken security model. Fortunately, it works very well these days with the amdgpu driver.

Re:Sandboxed Mac apps can record screen any time without you... by wander_homer on Sunday February 11, 2018 @03:25AM (#16351769)
However the way Wayland (or its broader ecosystem) "fixes" security is just stupid. Instead of using a fine grained whitelisting based permission system to grant different clients all the permissions they need to do their work (taking screenshots, reading the color of a point, listening to a certain key combination, apply some filtering to the display, get the size/position of a different client, ...) it treats every client as untrustworthy with no standard way to change that.

And let's not forget that just using Wayland doesn't grant any improved security compared to X11. There are numerous other ways to get input data, display contents, etc., so you need further sandboxing anyway, at which point you might just as well sandbox X11 clients you don't trust to get the same security. The benefit here is that you can decide if you trust your color picker and let it do its work by not sandboxing it, while Wayland just decides for you that no color picker can be trusted.

Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Sunday February 11, 2018 @04:14AM (#16351901)
> However the way Wayland (or its broader ecosystem) "fixes" security is just stupid. Instead of using a fine grained whitelisting based permission system to grant different clients all the permissions they need to do their work

Because you can't do that in Unix. You can't ensure that the process with PID 1234 is really executing /usr/bin/foo.

Re:Sandboxed Mac apps can record screen any time without you... by owl57 on Sunday February 11, 2018 @07:17AM (#16352377)
Assuming other apps are sandboxed from /proc/1234, can't the shell just exec "/usr/bin/foo" and pass some file descriptors or secrets in environment variables?
Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Sunday February 11, 2018 @09:29AM (#16352806)
How the wayland server and the shell are going to share (or agree to) that file descriptors or secrets in the first place? Or how can you ensure that the shell is not a rogue one?
Re:Sandboxed Mac apps can record screen any time without you... by owl57 on Sunday February 11, 2018 @12:06PM (#16353473)
> How the wayland server and the shell are going to share (or agree to) that file descriptors or secrets in the first place?

I read that GNOME just implements both in the same program (and calls it "shell").

> Or how can you ensure that the shell is not a rogue one?

I'm confused. Do you mean this kind of attack would become somewhat more probable or more dangerous if the original shell had some mechanism of allowing certain apps to pick colors?

Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Sunday February 11, 2018 @06:57PM (#16355535)
The reason that Wayland (or X11) protocol uses Unix sockets for communications is because there is not a hierarchical relationship between a client process and the server process (they can be even from different user "sessions"). Also, a client can be launched from anywhere, including a "shell" such as a /bin/bash interactive session.
Re:Sandboxed Mac apps can record screen any time without you... by alien_at_work on Monday February 12, 2018 @08:09AM (#16358335)
You can with SELinux, which is on all the major distros now, no?
Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Monday February 12, 2018 @10:02AM (#16358981)
I haven't heard about that, can you please provide a link?
Re:Sandboxed Mac apps can record screen any time without you... by alien_at_work on Monday February 12, 2018 @10:39AM (#16359274)
A link to info about SELinux? It's a rather broad topic, you'll probably be better served to google for what ever aspect of it you're interested in but it's definitely in Redhat (even turned on by default [1]) and it's on Debian (not sure if it's on by default there).

[1] https://access.redhat.com/solutions/3176 <--- here they show how to turn it off because it's in enforcing mode by default.

Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Monday February 12, 2018 @12:06PM (#16360002)
About how to use SELinux to ensure that a process with certain PID is running the intended executable and that it hasn't been tampered by the user (i.e. a rogue app running with user perms).
Re:Sandboxed Mac apps can record screen any time without you... by alien_at_work on Wednesday February 14, 2018 @11:41AM (#16377061)
Well, you'd need to read up on how SELinux works to understand that.

Briefly, SELinux adds some new permissions to files, new contexts to users and so on, so what happens is you specify what a given context is allowed to do, to a very granular level. For example, if you take postfix, it's split up into lots of programs, so you could say that the "init" context is allowed to run the postfix startup script but none of the rest of it. The postfix startup script will convert into some "postfix startup" context which is allowed to start the various programs but nothing else. So there will be a a postfix process that allows incoming IP addresses and can send on a specific FIFO and nothing else. There is another program which can read from the FIFO, change certain files and nothing else. So, imagine if you break into the program that talks with the internet: all you can do at that point is talk with the internet and talk with the FIFO. You can't read any files, write anything, execute anything, etc.

So that's kind of the idea of it. The above assumes an extremely tight SELinux configuration and no bugs in SELinux that would allow you to break out of your context. I've never seen a configuration as tight as described above but there did use to be a guy who had a Debian linux machine running on the internet where you could log in as root and try to break stuff. As far as I know, no one ever hacked that machine, starting out as root in a bash shell.

Re:Sandboxed Mac apps can record screen any time without you... by jcantero on Thursday February 15, 2018 @11:09AM (#16385099)
I fail to see how it can help in this case. The most fine-grained access you can achieve with SELinux are objects such as files or ports. What you need here is the ability to check if the other process has the permission to invoke certain operations from the current server through the Wayland protocol. It would be like arbitrary capabilities, but not linked to the operating system but to specific applications.

For example, in order for the Color Picker Tool to work, The Gimp should be marked with a "color picked allowed" capability, so when it asks the Wayland server for the color of pixels outside the surfaces it already owns, the server can check it and send the requested info. But a rogue program/process trying to scrap the screen content pixel by pixel shouldn't be able to do that. The inability to safely map processes to executables in Unix (and the possibility of manipulating their running code via exec(), library injection, ...) make it a very hard problem to solve without a paradigm shift that SELinux doesn't provide (as far as I can tell).

Re:Sandboxed Mac apps can record screen any time without you... by alien_at_work on Thursday February 15, 2018 @11:15AM (#16385156)
Oh I see. Yes, I don't think SELinux could do exactly the scenario you decide because the things you're mentioning don't exist at the OS level. If you can figure out a way to make them something SELinux can get a context onto then it would be possible.
Re:Sandboxed Mac apps can record screen any time without you... by upofadown on Sunday February 11, 2018 @07:58AM (#16352491)
Since I run all reasonably trusted open source software on my computer the sandboxing aspect of Wayland doesn't really help me. The one exception to this is the browser as those things now expose a vast attack surface. Unfortunately browsers are not sandboxed and they become significantly less functional if you somehow manage it. I don't care if my browser can't see the rest of the screen if it can see all my files and everything I do in other tabs on that browser.

So the benefits of the easier sandboxing provided by Wayland are somewhat overstated, at least for typical Linux users.

Re:Sandboxed Mac apps can record screen any time without you... by cesnja on Sunday February 11, 2018 @12:49PM (#16353728)
You can run the browser process in a separate mount namespace, only allowing it to access, for example, downloads folder, while everything else is off limits. I recommend Firejail.
Re:Sandboxed Mac apps can record screen any time without you... by woolvalley on Saturday February 10, 2018 @08:47PM (#16350707)
Permmissions dialogs for rare dangerous behaviors I think can work. You have to do it like apple does it although, not like android.

Like how often does software need to do screenshots, not many. Same with most other app permissions. Most only need network access and a folder.

Re:Sandboxed Mac apps can record screen any time without you... by mcny on Saturday February 10, 2018 @09:23PM (#16350817)
I'm afraid apps will abuse these permissions. For example, Facebook app (or a banking app) shouldn't quit if I refuse it a permission. I can't even use the default native email app (edit: on Android) with exchange without giving the exchange server remote administration access. Makes no sense.
Re:Sandboxed Mac apps can record screen any time without you... by woolvalley on Sunday February 11, 2018 @12:22AM (#16351321)
That is why permission state needs to be hidden / discouraged from apps. No permission just gives you empty data sets. They should be also rejected from app store if they try to cirumvent unless it's a central feature of the app, like a screenshot app or a location tracking app.

With the permission model of apps, then we can start having system apps like istat menus being sold on the app store again too.

I think you haven't used iOS that much. In practice it's fairly rare for an app to shut down without a permission unless it's central to the app.

Re:Sandboxed Mac apps can record screen any time without you... by firloop on Sunday February 11, 2018 @03:51AM (#16351828)
In fact, it's against the App Store guidelines to refuse to work without a permission (unless it's central to the app).
Re:Sandboxed Mac apps can record screen any time without you... by ndespres on Saturday February 10, 2018 @10:04PM (#16350959)
The Exchange server requesting remote permission is a "feature" which allows you or your company's Exchange server admins to send remote wipe command to the handset if it's lost or you leave the company. Not the specific fault of the permission model of the phone, it's part of the activesync suite.
Re:Sandboxed Mac apps can record screen any time without you... by eropple on Saturday February 10, 2018 @10:21PM (#16350996)
You can use the default email application on Android with services that don't want remote-wipe controls. Exchange does. That's how ActiveSync works. If you don't want that, use IMAP or POP3.
Re:Sandboxed Mac apps can record screen any time without you... by Larrikin on Saturday February 10, 2018 @10:24PM (#16351002)
How is the Android way different? We're two major and four minor versions since individual permission request were added.
Re:Sandboxed Mac apps can record screen any time without you... by woolvalley on Sunday February 11, 2018 @12:24AM (#16351325)
Android AFAIK shows a large laundry list of permissions you need to accept when you install an app and you can revoke after the fact. While on iOS there is no laundry list to accept and the built in annoyance of permission alerts encourages apps not to do it unless they need it.

Also android takes a while to propagate new versions onto the majority install base :)

Re:Sandboxed Mac apps can record screen any time without you... by Nullabillity on Sunday February 11, 2018 @06:49AM (#16352301)
You just replied to a post stating that this changed years ago.
Re:Sandboxed Mac apps can record screen any time without you... by badsectoracula on Saturday February 10, 2018 @11:25PM (#16351184)
> Imagine still actively using several perfectly good apps that were last updated 10 or 20 years ago?

I regularly use Borland C++ 5 (because it has a nice enough customizable IDE and a very fast C compiler which is practically instant on modern PCs), which (IIRC) was released in 1996. And i also use a ton of other stuff from the 90s, including many games.

Things already work without the overhead and resource wastage of virtual machines, all it takes is OSes and libraries try to not break their ABIs.

Re:Sandboxed Mac apps can record screen any time without you... by withoutclass on Saturday February 10, 2018 @08:15PM (#16350603)
We're there, check out Qubes OS
Re:Sandboxed Mac apps can record screen any time without you... by krisives on Saturday February 10, 2018 @08:57PM (#16350738)
Great when it works, one of the few variants of Linux that sometimes just doesn't like to run on some hardware still.
Re:Sandboxed Mac apps can record screen any time without you... by solatic on Sunday February 11, 2018 @07:12AM (#16352358)
> The advantage of running every app in their own VM means that apps won't get necessarily tossed to the side in this constant arms race of upgrades, especially for apps that don't need internet. Imagine still actively using several perfectly good apps that were last updated 10 or 20 years ago?

Not "especially for apps that don't need the Internet", only for apps that don't need the Internet. Anything that connects to the Internet needs constant and rigorous update discipline to stay ahead of a constant stream of exploits.

Sandboxing applications within their own VMs leads to a false sense of security. Now, whoever is responsible for distributing the app, is responsible for distributing the OS that runs the app as well. If the underlying OS doesn't get updated, Murphy guarantees that there will be an OS-level exploit within that VM. And then, even if the exploit is sandboxed to only affect that app and its OS, the attacker still owns anything that the user passes through that app, including but not limited to usernames and passwords (which are often reused across websites and apps), any sensitive information that passes through the app (banking and financial accounts, anybody?), and any privileges existing within the VM (session tokens, client keys, privileged access / firewall passthrough to other machines in the local network, etc.).

It's one thing to sandbox each app within its own userland-level sandbox, but sandboxing each app within its own VM / OS only makes security even more difficult. That kind of deployment model only makes sense if a sysadmin is doing so to make deployments more predictable and has the full power to reinitiate deployments when OS updates are released. On an end-user level, you're either risking the end-user's security (if upstream controls the OS update) or wasting the end-user's resources.

Re:Sandboxed Mac apps can record screen any time without you... by userbinator on Saturday February 10, 2018 @09:58PM (#16350939)
Imagine still actively using several perfectly good apps that were last updated 10 or 20 years ago?

I do. I don't know exactly what my oldest binary is, but it's probably from the 80s (some text processing utilities), and I still actively use apps I wrote myself over a decade ago. Of course, I use Windows which has historically been far better at backwards compatibility than Mac OS.

Re:Sandboxed Mac apps can record screen any time without you... by stephenc_c_ on Sunday February 11, 2018 @06:37PM (#16355459)
That's essentially what Docker containers have done to server-side applications. Every application is isolated from the host in a container and bundled with only the dependencies it needs. The only shared component is the kernel and anything you mount into it from the host.
Re:Sandboxed Mac apps can record screen any time without you... by 3pt14159 on Sunday February 11, 2018 @01:14PM (#16353881)
I tried doing this when I got a new MacBook Pro. The problem is all these damn pixels make it impossible to even quarantine the web browser unless you're willing on letting VM Ware patch your macOS kernel (uh, no thanks).
Re:Sandboxed Mac apps can record screen any time without you... by bradgessler on Saturday February 10, 2018 @10:23PM (#16351001)
Check out QubesOS.