mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4939] Deny CLONE_NEWUSER (restrict namespaces) #2832
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#2832
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 @rusty-snake on GitHub (Feb 13, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4939
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
An command (e.g.
nonewuser) which blocks calls toclone(and others likeunshare) ifCLONE_NEWUSERis set.Describe alternatives you've considered
N/A
Additional context
Flatpak does this for example.
@rusty-snake commented on GitHub (Feb 13, 2022):
If anyone wants to play (on x86-64 systems!):
.txtthat you need to add to files you upload to GHbwrap --seccomp 4 --dev-bind / / /bin/bash 4<~/Downloads/deny-clone-newuser.bpfunshare --usersource
Cargo.toml:
src/main.rs:
@topimiettinen commented on GitHub (Feb 28, 2022):
Good idea. I'd suggest a more generic command like systemd's
RestrictNamespaces=directive, which can block multiple namespaces (cgroup, ipc, net, mnt, pid, user and uts).@rusty-snake commented on GitHub (Feb 28, 2022):
Looking at
ee6fd6a509/src/shared/seccomp-util.c (L1206)this sums up to@rusty-snake commented on GitHub (Mar 18, 2022):
So after CVE-2022-0185 here's the next one CVE-2022-25636.
@rusty-snake commented on GitHub (Apr 1, 2022):
An the list continues with CVE-2022-1015.
@rusty-snake commented on GitHub (Jun 2, 2022):
https://seclists.org/oss-sec/2022/q2/159
@rusty-snake commented on GitHub (Jul 9, 2022):
CVE-2022-32250
Every month the same. And I don't even track all.
@ghost commented on GitHub (Jul 9, 2022):
Just posting this here because it might be of interest:
https://blog.cloudflare.com/live-patch-security-vulnerabilities-with-ebpf-lsm/
@smitsohu commented on GitHub (Jul 14, 2022):
Is someone working on this one or intends to do so?
If not I would be interested in taking it.
Maybe we can also set
/proc/sys/user/max_{cgroup,ipc,mnt,net,pid,time,user,uts}_namespacesto zero if there is anorootoption...These sysctls are namespaced and cannot be raised again inside the sandbox, because Firejail doesn't map root in the new user namespace, and also because
/proc/sysis read-only. As checks happen in a different place in the kernel, I think it would increase the overall robustness.@smitsohu commented on GitHub (Jul 15, 2022):
Or even better, unshare two user namespaces: The first user namespace only exists to impose limits on future namespace creation, by doing the equivalent of
echo 1 > /proc/sys/user/max_user_namespaces. Then unshare a second time, and build the sandbox in that second user namespace.This requires a non-privileged version of Firejail though, so we need the seccomp filter as well.
@rusty-snake commented on GitHub (Apr 29, 2023):
And more CVEs mitigated by this feature: CVE-2023-1281, CVE-2023-1829