mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4087] chromium: child processes escape the network namespace sandbox #2530
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#2530
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 @ghost on GitHub (Mar 12, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4087
Write clear, concise and in textual form.
Bug and expected behavior
I am running Chromium in a custom netns:
firejail --netns=for_wg chromium --user-data-dir="/home/lockywolf/.config/chromium" --disable-async-dnsThen I am finding firejail's pid:
pgrep firejail => 31669(I actually do this by looking at the process tree, as there are two firejails.)Then I look at the process tree:
Huh? PID 31708 escaped the sandbox? Checking:
Nothing!
I expected all Chromium's children to be in the for_wg netns.
No profile and disabling firejail
firejail --noprofile /path/to/programin a terminal?Nothing, same behaviour.
which <program>orfirejail --listwhile the sandbox is running)?I do not understand the question.
Reproduce
See above.
Environment
lsb_release -a,screenfetchorcat /etc/os-release)Slackware 15.0 alpha1, kernel 5.10.21, glibc 2.33, chromium 89.0.4389.72 (Developer Build) (64-bit)
firejail --version) exclusive or used git commit (git rev-parse HEAD)0.9.64.4
Additional context
Other context about the problem like related errors to understand the problem.
Exactly the same behaviour happens if I run chromium with
ip netns exec chromium ...Checklist
https://github.com/netblue30/firejail/issues/1139)--profile=PROFILENAMEis used to set the right profile. : Not an appimage.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.: yes, but I do not use U2F and do not keep chrome executables in ~/debug output
attaching stdout and stderr
firejail.chrome.debug.stderr.txt
firejail.chrome.debug.stdout.txt
The result of children being in a different namespace results in that different tabs of the browser are getting different routes and dns servers.
@rusty-snake commented on GitHub (Mar 12, 2021):
I guess that's because of chromiums sandbox. What happens if you start chromium with
--no-sandbox?EDIT: Does slackwares kernel support unprivileged userns clone? (
sysctl kernel.unprivileged_userns_clone)@ghost commented on GitHub (Mar 12, 2021):
Does what I expect it to do. Every child is in
for_wg. I would have closed this issue, but em... relying on chromium's good will doesn't infuse me with certainty.@rusty-snake commented on GitHub (Mar 12, 2021):
This sysctl is a debian patch (used by debian and arch). Mainline does not have it. So unprivileged_userns_clone is supported on your system if userns is supported at all (
sysctl user/max_user_namespaces!= 0). Then it should work for you the enablechromium-common-hardened.inc(firejail >= 0.9.65chromium-common-hardened.profile):Chromium has it's own sandbox (surprise 😎 ) with a suid-helper in
/usr/lib64/chromium/chrome-sandbox(or somewhere else, depending on distro/packages/chromium,vivaldi,brave,..). Chromium fails to start on systems w/o unprivileged_userns_clone if it's started with NO_NEW_PRIVS=1, in a own userns, with seccomp filters or a capability bounding set w/o CAP_SYS_CHROOT and CAP_SYS_ADMIN. Therefore all these this are allowed/disable by default.So it can run code as root in the default users with NO_NEW_PRIVS=0 and CAP_SYS_ADMIN. In general that's are good starting point to:
blacklistandwhitelistAFAICTYYou can also
sudo chmod -s /usr/lib64/chromium-browser-privacy/chrome-sandboxif unprivileged_userns_clone is enabled. I do this via package-manager hocks (needs to be done after every update).@rusty-snake commented on GitHub (Jun 10, 2021):
Any progress here?
@rusty-snake commented on GitHub (Aug 4, 2021):
I'm closing here due to inactivity, please fell free to request to reopen if you have more questions.