Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate and remove overly-powerful permissions #1152

Open
DemiMarie opened this issue Nov 7, 2017 · 18 comments
Open

Deprecate and remove overly-powerful permissions #1152

DemiMarie opened this issue Nov 7, 2017 · 18 comments
Labels
sandbox issue related to sandbox setup

Comments

@DemiMarie
Copy link

DemiMarie commented Nov 7, 2017

Currently, apps can request access to (for instance) a user’s entire home directory, to a shared /tmp, or to X11, the system message bus, or the session message bus. All of those can be used to run code with full privileges of the invoking user.

This is bad! Flatpak should not allow such powerful permissions. Instead, requests for any file that doesn’t belong to the app should be forced to go through a proxy, which allows the user to select a file (and which can deny the request). There is no reasonable way for a user to accept or deny requests for X11 or the system or user message busses, so these should never be allowed – Flatpak must have a hard dependency on Wayland, or launch a subsidiary X server for each instance of each app.

This will require that applications be modified to access user files via the provided Flatpak APIs rather than standard OS APIs, but I believe the tremendous security win (essentially, being able to download any arbitrary Flatpak program and run it without worrying that it will compromise your system – a guarantee that iOS and Android have offered since the very beginning) to be more than worth it. Application developers will need to get used to a Web-style model however (where the user, not the program, controls which files are opened).

@cgwalters
Copy link
Collaborator

The problem of course is access to X11; that'd impact everything. Though I could see it being useful to have the child X server be a builtin feature...there's lots of precedent for this.

I'd love to have a global switch which forces off access to ~, or perhaps better, supported redirecting requests for ~ to e.g. ~/ContainerHome or whatever I choose.

@TingPing
Copy link
Member

TingPing commented Nov 7, 2017

It just has to be a slow transition and perhaps less marketing calling it "secure" in the short term. Too many applications have to have holes to be usable, and "secure" also depends upon your definition. For example direct video card access is potentially very scary but we are a ways off from having a secure alternative to that (which will be much slower).

@alexlarsson
Copy link
Member

We want to ask for permissions before install and on update, tracked here: #275

However, completely dissallowing this is not a goal. We want to allow packaging existing apps, and most existing apps will not work without these permissions. In the future as we make the portals framework work and convert apps to use it things will get better, but right now if we didn't have this flatpak would be useless for anything but games.

We do support overriding app permissions, and we should perhaps have a global override feature that affects all apps.

@DemiMarie
Copy link
Author

@TingPing What would the secure alternative be?

@cgwalters I very much believe that we need to use a child X server and/or require Wayland as a mandatory dependency.

@TingPing
Copy link
Member

@TingPing What would the secure alternative be?

Few options like just relying on software rendering or something like virgl.
I vaguely remember another low level GPU virtualization research project but I can't find it.

@DemiMarie
Copy link
Author

DemiMarie commented Nov 13, 2017 via email

@TingPing
Copy link
Member

TingPing commented Nov 13, 2017

@DemiMarie It doesn't expose normal OpenGL to websites it only exposes WebGL which has less features and a few behaviors designed for better security such as zeroing out any memory before its handed to you (which is of course slower but probably reasonable).

@DemiMarie
Copy link
Author

DemiMarie commented Nov 13, 2017 via email

@TingPing
Copy link
Member

@DemiMarie Nothing, because websites don't use OpenGL directly nor do they have kernel access directly like Flatpaks.

@DemiMarie
Copy link
Author

DemiMarie commented Nov 15, 2017 via email

@amtlib-dot-dll
Copy link
Contributor

From https://fedoraproject.org/wiki/Changes/WorkstationOstree:

  • Wayland-related tasks
    • Make per-app xwayland possible for X apps
    • Kill abstract sockets that are problematic for sandboxing: X, dbus, ...

I am staying tuned 😶

@DemiMarie
Copy link
Author

@TingPing Chrome content processes cannot access OpenGL directly. All OpenGL calls are proxied through a GPU process. Flatpak should take a similar approach.

@alexlarsson
Copy link
Member

@DemiMarie Chrome only runs javascript using an OpenGL subset (webgl). Running arbitrary code and proxying its GPU access is not possible.

@mat8913
Copy link

mat8913 commented Sep 22, 2018

@amtlib-dot-dll

* Make per-app xwayland possible for X apps

Any updates on this?

@DemiMarie
Copy link
Author

DemiMarie commented Sep 22, 2018 via email

@amtlib-dot-dll
Copy link
Contributor

@mat8913

Any updates on this?

I'm afraid not, though I'm not concerned on this since long ago

@DemiMarie
Copy link
Author

DemiMarie commented Sep 23, 2018 via email

@amtlib-dot-dll
Copy link
Contributor

@DemiMarie There isn't any more information about this apart from that website 🤷‍♂️

May I ask why?

On Sun, Sep 23, 2018, 8:45 AM 朝歌 @.***> wrote: @mat8913 https://github.com/mat8913 Any updates on this? I'm afraid not, though I'm not concerned on this since long ago — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1152 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGGWB50fWsQ6sZtaY_ividF4IaPi3qdlks5ud4JvgaJpZM4QUUq3 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sandbox issue related to sandbox setup
Projects
None yet
Development

No branches or pull requests

7 participants