mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6] Cannot blacklist ${HOME}/.config/firejail #5
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#5
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 @boltronics on GitHub (Aug 10, 2015).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6
I was surprised there was no line in the default configuration like so:
blacklist ${HOME}/.config/firejailWithout that, an untrusted app could modify its own firejail profile and terminate. When it is relaunched (either automatically via a service management daemon or via user intervention), it could run with elevated privileges.
Even more surprising, manually adding the entry does nothing - the line is silently ignored.
@netblue30 commented on GitHub (Aug 12, 2015):
It seems to be working for me:
$ cat ttt
blacklist ${HOME}/.config/firejail
$ firejail --profile=ttt
Reading profile ttt
Parent pid 24098, child pid 24099
Child process initialized
$ ls ~/.config/firejail
ls: cannot open directory /home/netblue/.config/firejail: Permission denied
$
@boltronics commented on GitHub (Aug 15, 2015):
I just tried with the latest from git, and this is still a problem for me, so I digged deeper.
Since I'm using GNU Stow to manage my dotfiles, ~/.config/firejail is actually a symlink. Apparently firejail doesn't support following symlinks, which means many of the default profiles aren't protecting my setup at all. This is a worry.
I believe firejail should be resolving the actual location and blocking that (where
blacklist ${HOME}/.config/firejailwould effectively be equivalent toblacklist $(readlink -f ${HOME}/.config/firejail).Please see this link for more information on how it could be done in C:
https://stackoverflow.com/questions/7665/how-to-resolve-symbolic-links-in-a-shell-script
I think this can now be re-opened, or otherwise let me know if you would prefer me to open a new issue.
@ghost commented on GitHub (Aug 15, 2015):
@boltronics I currently can't reproduce this, I tried blacklisting a symlinked directory and it works fine. It follows the symlink and blocks what it points to. We'd need to know what you're seeing on your machine. Can you please let us know:
@boltronics commented on GitHub (Aug 15, 2015):
@pmillerchip
Strange. I can't see any way to avoid it. :)
1 and 2 - commands and output:
3 - expected output:
@ghost commented on GitHub (Aug 15, 2015):
OK I found (and fixed) the problem! @boltronics had a relative symlink (i.e. it started with
../) and firejail wasn't handling that right.@netblue30 : I've made a pull request to fix this, it just calls the
realpathstandard library function to do all the hard work for us, and it fixes the problem.@boltronics : Please compile firejail from the
symlink-bugbranch of my firejail repo here: https://github.com/pmillerchip/firejail.git ...and let me know if it fixes it for you.@boltronics commented on GitHub (Aug 16, 2015):
@pmillerchip Thanks for the quick patch! It's definitely making a difference, but not the right kind of difference. :)
Edit:
Sorry. I clearly looked at this too early in the morning, and made a mistake. The patch works fine. :)
@ghost commented on GitHub (Aug 16, 2015):
That's great news, glad it works for you. The pull request is up, so hopefully @netblue30 will merge it soon.