Whitelisting two .ini files opens up the whole home directory
Description
When trying to whitelist several dirs within /home for Firefox, the whole home dir gets whitelisted. I've pinpointed the problem to just two .ini files, installs.ini and profiles.ini. If they are not whitelisted, then everything is fine; but if they are whitelisted (and they need to be), then the whole home is accessible to Firefox.
Steps to Reproduce
Run firejail --profile=~/.config/firejail/firefox.local firefox. in Firefox go to any non-whitelisted address, for example file:///home/$user//Desktop. Check that the directory contents are visible and listed, despite being forbidden by the profile.
The FULL profile is below, nothing more is included.
whitelist ${HOME}/.mozilla/extensions
whitelist ${HOME}/.mozilla/firefox/*.ini
whitelist ${HOME}/.cache/mozilla
whitelist ${HOME}/.config/mozilla
whitelist ${HOME}/.local/share/pki
whitelist ${HOME}/.pki
whitelist ${RUNUSER}
whitelist /usr/share/*
private-etc firefox
private-bin bash,dbus-launch,dbus-send,env,firefox,sh,which
private-bin basename,bash,cat,dirname,expr,true,false,firefox,firefox-wayland,getenforce,ln,pidof,restorecon,uname
private-etc @tls-ca,@x11,mailcap,mime.types,os-release
private-tmp
dbus-user filter
dbus-user.own org.mozilla.*
dbus-user.own org.mpris.MediaPlayer2.firefox.*
ignore dbus-user noneThen comment out the line
whitelist ${HOME}/.mozilla/firefox/*.iniand whitelisting works correctly (directory is not accessible).
The two problematic .ini files, installs.ini and profiles.ini, are ordinary text files, not hard or soft links.
Expected behavior
Only whitelisted directories within /home should be accessible. Whitelisting two more *.ini files within ~/.mozilla should not change that.
Actual behavior
Whitelisting within /home is not enforced
Behavior without a profile
Unapplicable
Additional context
Environment
- Name/version/arch of the Linux kernel: Linux 7.0.10-arch1-1 x86_64
- Name/version of the Linux distribution: "Arch Linux"
- Name/version of the relevant program(s)/package(s): firefox 151.0.4
- Version of Firejail (
firejail --version): 0.9.80 - If you use a development version of firejail, also the commit from which it was compiled: no
Checklist
- I am using firejail 0.9.80 or later
- I am using the full program path (e.g.
firejail /usr/bin/vlcinstead offirejail vlc; seehttps://github.com/netblue30/firejail/issues/2877) - The issues is caused by firejail (i.e. running the program by path (e.g.
/usr/bin/vlc) "fixes" it). - I can reproduce the issue without custom modifications (e.g. globals.local).
- The program has a profile. (If not, request one in
https://github.com/netblue30/firejail/issues/1139) - The profile (and redirect profile if exists) hasn't already been fixed upstream.
- I have performed a short search for similar issues (to avoid opening a duplicate).
- I'm aware of
browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.
- I'm aware of
- I used
--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)
Log
Output ofLC_ALL=C firejail /path/to/program
Reading profile /home/user/.config/firejail/firefox.local
firejail version 0.9.80
Parent pid 441253, child pid 441257
20 programs installed in 38.27 ms
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Private /etc installed in 71.15 ms
Base filesystem installed in 2.01 ms
Child process initialized in 269.88 ms
Parent is shutting down, bye...LC_ALL=C firejail --debug /path/to/program
output goes hereSource: netblue30/firejail