mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #998] gui isolation through wayland #680
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#680
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @valoq on GitHub (Dec 23, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/998
Since the X11 protocol does not have any isolation between clients, all client application can e.g. see the input actions of each other, allowing keylogging and so on.
However the new wayland protocol does isolate clients from each other. Some applications like evince already have native wayland support.
For others there is Xwayland, which is basically a xorg-server that allows to run x application with wayland.
While testing the wayland implementation weston, which can be run inside X11 as well, I notice each weston instance uses its own xwayland server.
When running xinput, keylogging is possible for X11 applications of the same weston instance, but not for applications in other weston instances or the native Xorg-server (if weston is run within a X11 session). This is probably because X11 applications started inside weston, have their own X11-server (Xwayland :1, Xwayland :2 ... )
I have not yet found a way to effectively run single applications that way without starting the weston window manager, but it should be possible. (xweston provides a small script to run weston without the actual window-manager, allowing other X11 window manager to use Xwayland)
Using wayland/weston and the Xwayland server in this way it might provied an additional way to sandbox X11 applications via the --x11 option.
The tests I have done so far show that using weston is way faster (no noticeable wait time at all) and more reliable then xpra (which takes a couple of seconds to start and has some other issues).
Things like copying between applications using different window server is not possible however.
But the primary goal of --X11 is isolation and that can be archived with this approach.
@xahare commented on GitHub (Dec 24, 2016):
had to use 'wayland --modules=xwayland.so' to get it to make different x servers, but thats probably distro dependent.
when wayland has that module loaded, any app can see the clipboard by calling xsel -b even if the data hit that clipboard from a weston app. --x11=none for all weston only apps should fix that. need to try it.
i think wayland needs an x server thats not implemented as a module, but as a normal wayland client so it cant see the clipboard until its given to it like all other clients. then firejail could use this.
@netblue30 commented on GitHub (Dec 27, 2016):
My understanding is wayland will solve all problems by default, so when you run "firejail firefox" under wayland, you should already have all possible x11 protection. I am still to try wayland, we'll see how is going.
@valoq commented on GitHub (Jan 4, 2017):
Thanks for the info.
However in many cases, access to the clipboard is wanted and while it is important to be able to block it, preventing access to the input of other applications seems to be the main concern.
Best case would be to be able to define the access direction of the clipboard.
Meaning that it would be possible to forbid an pdf viewer to read the clipboard but allow it to write to is so that text can be copied from a pdf file.
@netblue30 commented on GitHub (Jan 4, 2017):
What distro are you running? I've never seen wayland running.
@xahare commented on GitHub (Jan 4, 2017):
hiding the clipboard allows for password managers and prevents accidental leaks. one side effect of waylands built in isolation is not being able to type into another application. as far as i know, only the compositor could do this, but i havent read the protocol spec yet. i doubt anyone would want to build their password manager into the compositor. (now that i think about this, starting to like the idea) the other way this could work is by wrapping your stuff into a virtual machine, with your password manager in another vm, which is how im doing it now. kvm and vmware both support wayland.
for wayland, im running fedora 25. its the only distro i know of actively supporting wayland, and most of the apps run through that. the big exception is web browsers. epiphany is the only one, but its not secure enough for the big scary internet (you cant turn off javascript, drive by downloads etc)
have not found a way to disable the xwayland module in mutter, gnomes compositor. as a module it sees all clipboard, but as just a wayland client, i dont think it would have this issue.
pureos, based on debian, has a version in development built on wayland.
@valoq commented on GitHub (Jan 5, 2017):
The reference implementation of wayland is weston. I believe Ubuntu Gnome 16.10 uses wayland it by default as well.
@faern commented on GitHub (Dec 29, 2020):
A long time has passed since this issue was closed. Is it still not possible to isolate X11 programs from each other by making use of XWayland in the jails? I'm trying to run a Wayland native machine with XWayland disabled. So I was hoping to jail the few X11 programs I need until they get native support.
--x11=xwaylandwould be such a nice thing if it did work.I guess my other solution is a VM +
waypipe. But that obviously has a bunch of downsides when I want to share parts of the filesystem with the jail etc.@rusty-snake commented on GitHub (Dec 29, 2020):
No, still no such option. However it looks like you can start
Xwayland :2, start a window manager like openbox in it and the runfirejail --env=DISPLAY=:2 x11onlyprogram.@faern commented on GitHub (Jan 3, 2021):
It sounds like a nice solution. But I can't get it to work. I have tried a few combinations, but basically running this:
Gives me no new window to look at with eyes that follow my cursor. The three processes just sit there in silence. I'm not sure where it fails.
If I don't give
-rootlesstoXwaylandI instead get this:@rusty-snake commented on GitHub (Jan 3, 2021):
Gives me the funny eyes in the Xwayland-window. (Fedora 32 Workstation)
@faern commented on GitHub (Jan 3, 2021):
Which of the commands even give you this window? I don't have any window at all showing up from any of these commands. I'm running Fedora 33 workstation with Swaywm.
If I add debugging output to openbox I see this:
@rusty-snake commented on GitHub (Jan 3, 2021):
Xwayland :2after around a half second.If you have already disabled Xwayland in sways config, my guess is that this happens because it's the first Xwayland. Maybe test if a second
Xwayland :3opens up a window. If so, there's hopefully a option in Xwayland for that.@faern commented on GitHub (Jan 12, 2021):
I never get any window from running
Xwayland ...:O I have tried both in Sway and Gnome and both with and without disabling XWayland in Sway. And I have tried starting two instances manually. No dice. I'm on Fedora 33, a pretty standard setup I would say. Reinstalled just a few days ago. The difference I can think of is that I have to give-rootlessfor it to not just exit with an error instantly.@rusty-snake commented on GitHub (Jan 28, 2021):
Using
-rootlessdoesn't open a window for me too.@NobodyXu commented on GitHub (Mar 3, 2021):
Maybe x11docker will help:
Despite it is designed for
docker, you might be able to modify the script in there to supportfirejail.