mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #380] Programs start without sandbox if /proc is mounted with hidepid #273
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#273
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 24, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/380
If the
/procfile system is mounted withhidepid=1orhidepid=2, firejail reports to have detected an existing sandbox (as it can't see the kernel processes), starting the program in a normal/bin/shshell. While this can be avoided using--force, it looks like a security problem to me as the warning can't be seen unless firejail is started in a terminal, making it seem like the program is sandboxed when it really isn't./bin/shshell, the default behavior in my opinion should be not to start the program unless a special command-line flag is used. Otherwise, people might restrict access to kernel processes, not realizing that their sandbox isn't being used anymore.@ghost commented on GitHub (Mar 26, 2016):
Would you accept a pull request that changes the default behavior to require an
--allow-no-sandboxoption (or similar) for firejail to use an insecure/bin/shshell, so that, when an existing sandbox is detected:--allow-no-sandboxuses a normal, insecure/bin/shshell--forceuses a sandbox (no change necessary)--forcetakes precedence)@netblue30 commented on GitHub (Mar 28, 2016):
I would leave it as is for now, probably there will be more changes in the future.
The question is this: you are in a sandbox, and you try to start another sandbox, what should happen? For Mozilla Thunderbird users this happens every time when they click a link in an email. So far the only idea I had was to start Firefox in the existing sandbox.
@ghost commented on GitHub (Mar 28, 2016):
You're right, I didn't think about that.
Do you have any idea how a sandbox could be detected other than by kernel processes? If not, let's close this issue?
@netblue30 commented on GitHub (Mar 28, 2016):
Probably there are other ways. The kernel gives out some inode numbers in /proc/self/ns, you can compare these numbers with a regular process and detect the namespaces.
@Sidnioulz commented on GitHub (May 30, 2016):
@netblue30 not sure what exactly is the mechanics behind the Thunderbird situation, but on my fork I expect all my Xfce apps to use libxfce4ui's spawning function, and that function will detect if it is in a sandbox and then run "unsandboxed" (as in, not prepend firejail to the arguments being executed, resulting in the newly executed app being in the same container as its parent).
Assuming that you refer to Thunderbird running a .desktop file that does "firejail firefox", then the issue is that the .desktop file should embed that information another way (.desktop files have a special key in my fork indicating that Xfce should sandbox them) and the spawning utility used should be compatible (so that the initial run of the .desktop file in an unsandboxed environment properly runs it in a sandbox, and runs inside existing sandboxes put the new app inside that existing sandbox).
This is reliable and, as I see it, allows legitimate use of program helpers without raising security issues. But then again I have window decorations that clearly indicate the domain in which a windowed program is, you'd need that too to avoid user errors (using Thunderbird's firefox rather than another sandboxed firefox, when both are running).
@deathtrip commented on GitHub (Jul 31, 2016):
I have /proc mounted with hidepid=2, and when i start a sandboxed program from the terminal, everything seems ok.
No report of an existing sandbox.
However no sandbox can be seen by using "firemon --list" or by firetools.
@netblue30 commented on GitHub (Jul 31, 2016):
How do you mount /proc with hidepid=2?
@deathtrip commented on GitHub (Jul 31, 2016):
here's the fstab entry:
proc /proc procfs hidepid=2,gid=proc 0 0
and the group file entry:
proc❌26:polkitd
@netblue30 commented on GitHub (Aug 1, 2016):
I'll give it a try, thanks.
@deathtrip commented on GitHub (Nov 9, 2016):
any progress on this?
@netblue30 commented on GitHub (Nov 9, 2016):
Are you talking about this?
@deathtrip commented on GitHub (Nov 9, 2016):
Yes.
@netblue30 commented on GitHub (Nov 10, 2016):
I'll try to bring in a fix.
@netblue30 commented on GitHub (Nov 12, 2016):
Fixed!