mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3767] firefox: keepassxc browser extension fails due to whitelist-runuser-common #2375
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#2375
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 @kris7t on GitHub (Nov 22, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3767
Since
096d0de5f8,firefox-common.profileincludeswhitelist-runuser-common.inc.This breaks compatibility with the KeePassXC browser plugin, which uses the socket
${RUNUSER}/org.keepassxc.KeePassXC.BrowserServerto communicate with KeePassXC (see https://github.com/keepassxreboot/keepassxc/blob/develop/src/browser/BrowserShared.cpp#L30-L37).The problem here is that the socket might not exist when Firefox starts if KeePassXC hasn't started yet. Additionally, KeePassXC might quit and restart any time during when Firefox is running. So we can't just
We can redirect where KeePassXC puts its socket by the environmental variable
SNAP_USER_COMMON, but only when it was compiled as a snap (#define KEEPASSXC_DIST_SNAP). So to allow Firefox to communicate with KeePassXC, currently the only solution isCan we do anything with this? One possible solution is to raise an issue with KeePassXC to make the let the socket location be customized with an environmental variable, and the put the socket to some directory that is allowed inside
${RUNUSER}.The other, perhaps more general approach I can think of is to watch
${RUNUSER}outside of the sandbox with inotify, and mount new sockets matching a name (if the profile is explicity configured to do so) inside the sandbox, too (and when a socket disappears from outside, also remove it inside the sandbox). However, this seems extremely impractical, as mounting the sockets inside the sandbox would require firejail to maintain root privileges.@rusty-snake commented on GitHub (Nov 22, 2020):
KeePassXC was the reason why I did not add wruc initial to firefox because
ignore includewasn't supported at this time. Then I stopped to use KPXC-Browser because it looks like it is fingerprintable. Before adding it here to firefox I had some testing, but they changed the socket name, this has destroyed my test I think.IMHO we should addignore include whitelist-runuser-common.inctofirefox-common-addons.inc.UPDATE: I already added it in
096d0de. However a comment would be nice.Using
XDG_RUNTIME_DIRisn't a solution too, since we would need to bind-mount wayland, Xauth, pulse, ....@kris7t commented on GitHub (Nov 22, 2020):
Maybe we could still manage with a proxy? I.e., run some process in
sbox_runthat listens on a socket${TMPDIR}/org.keepassxc.KeePassXC.BrowserServerin the sandbox (if${RUNUSER}is not writable, KPXC-Browser falls back to${TMPDIR}). For each incoming connection, the proxy attempts to connect to${RUNUSER}/org.keepassxc.KeePassXC.BrowserServeroutside the sandbox by path (and not by anO_PATHfd!) and passess messages is both directions through. Could beto support wruc with sockets in a generic way.
Although even this might not be practical: we must ensure that
For a single communication pathway (KPXC <-> Firefox), it seems easy enough to use
$XDG_RUNTIME_DIRby hand: just create a new directory somewhere, bind-mount wayland, pulse before either of KPXC or Firefox starts, then run both of them with$XDG_RUNTIME_DIRset to the new directory. The original/run/user/$UIDcan be blocked entirely. However, if there are multiple browsers, they'd need to share$XDG_RUNTIME_DIR(which is no worse than what we have without wruc).Of course, this is all just theoretical: In practice, it's simple and safe enough to
ignore include whitelist-runuser-common.inc.