mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4103] Can't combine private-home and whitelist for Firefox #2533
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#2533
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 @BreakfastSerial on GitHub (Mar 16, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4103
I'm trying to run Firefox (
/usr/bin/firefox, firefox not symlinked to firejail) in a firejail. Any changes to Firefox should be discarded, when Firefox is closed. However I need the profile from~/.mozilla. For this I used--private-home=.mozilla.I still want persistent Downloads from Firefox, so I added
--whitelist=~/Downloads.Downloads are not made available outside of the firejail.
I also tried to add
--private-home=.mozilla,Downloadsand--noprofile, with the same result.Alternatively, I attempted the same approach with
--overlay-tmpfs, but the whitelist is also ignored.Reproduce
Steps to reproduce the behavior:
firejail --private-home.mozilla --whitelist=~/Downloads /usr/bin/firefoxEnvironment
Checklist
https://github.com/netblue30/firejail/issues/1139)--profile=PROFILENAMEis used to set the right profile.LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.@ghost commented on GitHub (Mar 16, 2021):
--private and --private-home discard all modifications when the sandbox is closed.
The stock firefox profile already whitelists ${HOME}/Downloads (in firefox-common.profile), so there's no need to add that on the command line (or in a script). You'll need to
transfer outfiles you'd like to keepbeforeclosing the sandbox. See section FILE TRANSFER inman firejailfor details on how to do that.Example:
@BreakfastSerial commented on GitHub (Mar 16, 2021):
So there's no option to have specific directories in a temporary overlay filesystem and be discarded when closing the sandbox, while other directories remain whitelisted?
I'm afraid manually transferring files is not a viable option. I've been working with the approach previously suggested, but that becomes problematic, working with different firefox/firejail profiles simultaneously.
@ghost commented on GitHub (Mar 16, 2021):
None that I'm aware of. There's a fundamental difference between black/whitelisting on the one hand and a throwaway sandbox on the other. At least that's my understanding of the basics. On top of that, fixing CVE-2021-26910 implied disabling overlayfs support alltogether (which should be confirmed in the output of
firejail --versionon your end). Thanks to your report I've noticed that there are still a few places in the code base that mention overlayfs and that's all very confusing. I'll need to do some more testing on this, but I'm preparing a PR to rectify/unconfuse this situation.I do realize this makes things more complicated, but it works. The trick is to add a different --name=foo option to all the specific firefox instances you like to set up on your system. Once you do that, things start to come together and get more manageable IMO.
@BreakfastSerial commented on GitHub (Mar 16, 2021):
Thank you for bringing that CVE to my attention! On
Ubuntu 20.04.2 LTS, overlayfs is still enabled.@ghost commented on GitHub (Mar 16, 2021):
A sad but true fact of life: not all distro's get our CVE fixes out in a timely fashion... See another collaborator's view on this here. In your case, being on 20.04.2 LTS, I'd advise installing/updating firejail from this PPA, which happens to be maintained by one of our collaborators and who is involved in packaging for Debian.
@reinerh Is there a list somewhere with info on what Ubuntu edition has the fix for the latest CVE or not? just so we can assist users more correctly when this topic creeps up...
@rusty-snake commented on GitHub (Mar 16, 2021):
@glitsj16 After discussion in https://github.com/netblue30/firejail/issues/4006#issuecomment-785144480 @VorpalBlade has opened https://bugs.launchpad.net/ubuntu/+source/firejail/+bug/1916767. After two weeks he/she got a response (bold from me):
Ubuntu and Mint don't get CVE fixes for packages outside of main or only very late.
If someone wants to submit a debdiff (actually IDK what this is): https://bugzilla.redhat.com/show_bug.cgi?id=1934020#c4
Uhh and if you want to know what Fedora Linux (😉) does look at https://bugzilla.redhat.com/show_bug.cgi?id=1934020 and https://bugzilla.redhat.com/show_bug.cgi?id=1934022 and https://bugzilla.redhat.com/show_bug.cgi?id=1929625.
Status: CLOSED WONTFIX
Or Alpine Linux which is still at 0.9.64 (packages has be flagged since 0.9.64.2 IIRC)
ArchLinux, Gentoo, Debian (stable and sid), OpenSUSE Leap and OpenSUSE Tumbleweed has distributed patched/backported/updated/.. version in a reasonable time according to my observation.
IIRC was Manjaro very late too, however timestamp of the packages gives the impression they very fast. But the timestamp could be kept by a testing to stable move and if it was in testing for week they were late.
@rusty-snake commented on GitHub (Mar 16, 2021):
Back to topic
Partly a duplicate of #1743 and [cloud find this one].
@ckorder commented on GitHub (Mar 17, 2021):
@BreakfastSerial
for example: /usr/local/bin/whatever
firejail --private=/home/user/Templates/whatever/ firefox && rm -rf /home/user/Templates/whatever/noob
does only work if you close the sandbox the proper way
rm these and keep download should achieve your goal.
/home/user/Templates/test/.cache
/home/user/Templates/test/.config
/home/user/Templates/test/.mozilla
/home/user/Templates/test/.bashrc
/home/user/Templates/test/.Xauthority
ur welcome
@BreakfastSerial commented on GitHub (Mar 17, 2021):
Thank you for the insight and the suggestions! I see there's not proper way of implementing what I am looking for, so I'll figure out a workaround.
@rusty-snake commented on GitHub (Mar 17, 2021):
Replace the
&&with a;and it works always.@rusty-snake commented on GitHub (Mar 17, 2021):
Example wrapper script (UNTESTED!):
@reinerh commented on GitHub (Mar 27, 2021):
Ubuntu also has a security tracker: https://ubuntu.com/security/CVE-2021-26910
I have just submitted a patch to the launchpad bug to get 20.04 LTS updated. Let's see how long it takes...