mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4668] Chasing SUID executables #2745
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#2745
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 @netblue30 on GitHub (Nov 4, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4668
I am looking for SUID executables still visible inside the sandbox. Most of them are cleaned up by disable-common.inc. I added some more:
I'm not sure about some of them, so things could break!
Let's look for some more SUID (it kind of depends on what you have installed on your computer):
Start a browser (firejail --name=browser firefox) and join the sandbox from another terminal (firejail --join=browser). Then, run the find command and add them to the list:
Thanks!
@rusty-snake commented on GitHub (Nov 4, 2021):
Fedora 34:
TBH suid binaries are already mitigated by nnp.
@ghost commented on GitHub (Nov 4, 2021):
Arch Linux
$ firejail --profile=/etc/firejail/disable-common.inc find / -perm -u=s -type f 2>/dev/null | sort@kmk3 commented on GitHub (Nov 4, 2021):
@glitsj16 commented on Nov 4:
On Artix Linux, new paths compared to the above:
@topimiettinen commented on GitHub (Nov 5, 2021):
Debian bookworm/sid. I added
-xdevso/home,/proc,/varetc are not checked in vain:But none of the above SUID exes are actually able to change UIDs, because all file systems except
/setuidare mounted withnosuidflag:Then
/setuidis blacklisted in Firejail to disable all SUID exes with one line.I've used the awesome possibility in Debian to divert selected files elsewhere with
dpkg-divert, so for example when I updateiputils-pingpackage containing setuid (actually only setcap)/bin/ping,/setuid/pinggets smoothly updated. I've added a symlink from/usr/bin/pingto/setuid/ping. But I don't care aboutgst-ptp-helperetc. and nothing seems to be broken due to their lack of SUID either. Do any non .deb distros have also this feature?@rusty-snake commented on GitHub (Nov 5, 2021):
Fedora:
*:in:dnf repoquery --list --installed ${name} | xargs …)@reinerh commented on GitHub (Nov 5, 2021):
@ghost commented on GitHub (Nov 6, 2021):
Xubuntu Focal (20.04):
@kmk3 commented on GitHub (Nov 6, 2021):
What if firejail always bind-mounted certain paths with
nosuidby default? Ithink the base paths below would cover all suid paths posted here:
Currently, there is only
noexec, which disables suid, but also exec. Therecould be a new
nosuidoption to only disable suid.Then, the base paths could be added on disable-common.inc:
And ignored on profiles with:
This could be done in addition to blocking individual suid paths, as a sort of
fallback.
@topimiettinen commented on GitHub (Nov 7, 2021):
I suppose even
nosuid /could be default, at least when nnp is active. Though sadly SELinux usesnosuidto determine whether certain domain transitions are allowed (https://github.com/systemd/systemd/pull/19902, https://github.com/systemd/systemd/pull/20023), sosuid/nosuidisn't so simple after all.@rusty-snake commented on GitHub (Nov 7, 2021):
@topimiettinen would
nosuidmake any difference with nnp?@topimiettinen commented on GitHub (Nov 7, 2021):
Not really. There could be an obscure case where something without NNP gets access to the mount namespace and then it could be useful if also
nosuidwere used. It's also more or less free if mount namespaces are used anyway.@raphaelr commented on GitHub (Nov 11, 2021):
Debian testing (bookworm):