mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1652] Odd behaviour with --x11=xorg under GNOME 3 / gdm #1114
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#1114
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 @sakaki- on GitHub (Nov 17, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1652
Hi, as I mentioned in #1600 I am putting together an addition to my EFI Install Guide regarding the use of an X11-sandboxed (Xephyr) sandbox for use with firefox.
I now have a configuration that works even with WiFi interfaces, using the bridge configuration suggested your answer to #1600, so thanks for that.
However, having read about the
--x11=xorgoption in thefirejailmanpage, I thought I'd give that a try too, since it would be much simpler to setup for most users. I recompiled my X server using thexcsecurityUSE flag (I use Gentoo), restarted, and then tried to see if e.g.xinputwould be blocked from scanning keyboard input when untrusted, as it should be. However, startingbashunder thefirefoxprofile with--x11=xorgdid not give the expected results:Other commands, such as
xinput test 9worked too. So (still in the sandbox, I tried):Note that
/run/user/1000/gdm/Xauthorityis not the~/.Xauthoritypath thatfirejailbind mounts its untrusted xauthority into:a1530b3f53/src/firejail/x11.c (L1195-L1217)I am running a GNOME 3 desktop, with
gdmas the login manager. The above/run/user/1000/gdm/Xauthorityis still present (not blacklisted) in the sandbox environment, and selected by default as theXAUTHORITY:Trying to force the issue seemed to work (above sandbox was closed first):
But appeared to be easily overridden in the sandbox (even though
/run/user/1000/gdm/Xauthoritywas inaccessible now), by simply blanking the environment variable:Anyway, as I said I have a working
xephyrsetup that I'm writing up now, but thought this might be useful info to pass on, as there have been a few other reports of--x11=xorgnot behaving quite as expected (e.g. https://github.com/netblue30/firejail/issues/57#issuecomment-266254926).I am running version 0.9.50 of
firejailfrom the standard Gentoo repos.@SkewedZeppelin commented on GitHub (Nov 17, 2017):
An easier solution* is to simply run GNOME under Wayland. Wayland adds a decent amount of separation, however a lot of the community always says its useless since the apps aren't sandboxed. But Wayland + Firejail makes for an awesome combination.
Be warned though that even under Wayland that legacy X apps will still be able to see the input of other X apps (since they all share a single Xwayland process). Eg. if you're playing a proprietary game its anticheat might key-log what you type into Chromium, but at least it can't capture your screen (I think).
You can see what apps are currently using X by running
xlsclients@sakaki- commented on GitHub (Nov 17, 2017):
@SpotComms, thanks for the tip. My guide is currently oriented towards to those using GNOME on X11, but I will probably migrate it to cover Wayland at some point in the future.
That being said, the
xephyrapproach works well enough; the point of filing this issue is really to point out that for GNOME 3 /gdmat least, the user's xauthority file is not in the~/.Xauthoritylocation thatfirejailexpects (and bind-mounts a freshly created, untrusted .Xauthority over when--x11=xorgis specified), nor is the actualgdmxauthority path (/run/user/<uid>/gdm/Xauthority) blacklisted, so people may get a false sense of security. Perhaps a warning could be printed if using--x11=xorgand the environment$XAUTHORITYis not pointing to the expected path.@smitsohu commented on GitHub (Oct 8, 2019):
Hm, turns out the experimental fix
b35c000feeis broken as well.I was under the impression I had it working 😕
I'll probably have to revert it.Even though some issues remain, the fix IMHO is a step in the right direction, so not reverting