mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6927] firefox: file picker is not sandboxed #3421
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#3421
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 @rieje on GitHub (Oct 6, 2025).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6927
Description
When using XDG file picker instead of the built-in file picker for Firefox, it is not sandboxed. It has access to files on the host filesystem. Consequently, selecting any file with it results in Firefox producing the error "no read permissions".
Expected behavior
I'm using xdg-desktop-portal-termfilechooser as the XDG file picker and it should be restricted to the same sandboxed filesystem that FIrefox sees and selecting files for Firefox should be possible. I've also tried GTK file picker and same issue.
Actual behavior
The file picker is not running in/on the sandbox filesystem. If I go to the address bar and type
/home/rieje, I can confirm Firefox instance is sandboxed. If ICtrl-oto launch the terminal file picker, it has access to my host filesystem, i.e. it's not sandboxed.Behavior without a profile
Same behavior as above.
Additional context
To set up the terminal XDG file picker for Firefox, I'm using xdg-desktop-portal-termfilechooser) and running Alacritty terminal on Yazi file manager and followed its configuration, which involves. editing the following configs/scripts. I haven't done anything additional on firejail's side of things, not sure if they need to be whitelisted or how to best go about that.
~/.config/xdg-desktop-portal-termfilechooser/config~/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh~/.config/xdg-desktop-portal/portals.conf/usr/share/xdg-desktop-portal-termfilechooser/Changes to the config above requires restarting the services:
systemctl --user restart xdg-desktop-portal-termfilechooser.servicesystemctl --user restart xdg-desktop-portal.serviceWith Firefox this
about:configsetting needs to be set:widget.use-xdg-desktop-portal.file-pickerto1to use the XDG file picker.If I run Firefox unsandboxed, the file picker works fine--it can pick files for Firefox because they both see the same filesystem. If Firefox is sandboxed and I don't use the XDG file picker and instead rely on the default file picker for Firefox, it can also pick files and sees only files in the sandbox as expected. I'm not sure if the issue is the XDG file picker escaping the sandbox or if it's somehow started outside the sandbox which would be surprising to me because my intuition is that anything started by sandboxed Firefox is a subprocess.
Environment
uname -srm): Linux 6.16.10-arch1-1 x86_64mesa 1:24.3.3-2"): firefox 143.0.4-1
firejail --version): 0.9.76-1Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
Output of
LC_ALL=C firejail /path/to/programOutput of
LC_ALL=C firejail --debug /path/to/programfjdebug.txt
Relates to:
@kmk3 commented on GitHub (Oct 6, 2025):
I'm not sure about that specific file picker, but in general xdg portals access
the system through dbus, which is not sandboxed, as it runs as a daemon.
So the file picker showing more files than what is available in the sandbox is
expected behavior.
Theoretically this should not be an issue, but if you want to avoid potential
sandbox escapes through dbus, block it (
dbus-system none+dbus-user none)and avoid using xdg portals.
This might be due to:
@lucasmz-dev commented on GitHub (Oct 6, 2025):
Or you grant firefox org.freedesktop.portal.Desktop
@kmk3 commented on GitHub (Oct 10, 2025):
Good idea.
@rieje
Does adding the following to firefox.local change anything?
If that does not work, try commenting firefox.profile and
firefox-common.profile until it works to find out which lines are causing the
problem and post them in here.
@lucasmz-dev commented on GitHub (Oct 10, 2025):
Sorry I meant what he said also happens if you grant that. You might even need to, unsure. It's kind of messy because it doesn't work either way IME, only with directories the firejail sandbox grants access to.
@rieje commented on GitHub (Oct 13, 2025):
firefox-common.profile already includes
dbus-user.talk org.freedesktop.portal.Desktop. I tried to be as permissive as possible, but same issue:Without setting the about:config setting, it won't pick up the preferred XDG portal set at
~/.config/xdg-desktop-portal/portals.conf.