mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4705] firejail tree+list flags bypass hidepid mounted /proc displaying details of other users sandboxes #2755
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#2755
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 (Nov 21, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4705
Originally assigned to: @netblue30, @smitsohu on GitHub.
Discussed in https://github.com/netblue30/firejail/discussions/4703
Originally posted by RyanOblivion112 November 21, 2021
Is this a bug or the intended behavior? It seems like it would be a bug since using firemon with/without the --tree/--list flags fails as expected with the message:
Error: /proc is mounted hidepid, you would need to be root to run this commandIf it is intentional is there a setting that will "fix" it?
firejail version information(Fedora 34):
@ghost commented on GitHub (Nov 24, 2021):
Something that may or may not be related is that I used to be unable to see firejail'd processes at all via top/ps(without root) when using a hidepid mounted /proc, and I can see them now. Unfortunately I can't recall if back then I was still able to see other users firejail processes when I ran firejail as a regular user with --tree/--list or not.
So it could be related to whatever change fixed that issue.
@emerajid commented on GitHub (Apr 15, 2024):
I wrote some garbage that seems to work. Diff is against the 0.9.72 release. I know nothing of writing secure or reliable programs, so you'd think twice before using it.
@ghost commented on GitHub (Apr 20, 2024):
@smitsohu @topimiettinen Any opinions on the code quality of proposed fix from https://github.com/netblue30/firejail/issues/4705#issuecomment-2057967543?
@topimiettinen commented on GitHub (Apr 21, 2024):
The approach is to filter /proc entries if the UIDs don't match. There should be a better way: don't allow joining namespaces of other users in the first place. I'm also wondering why drop_privs() keeps RUID==0.
@emerajid commented on GitHub (Apr 21, 2024):
Why exactly?
Because when hidepid is in action SBOX_ROOT flag is used and privileges are elevated to full root before executing firemon to provide compatibility with grsecurity. It's written in the source.
@topimiettinen commented on GitHub (Apr 21, 2024):
Your proposed method could be prone to TOCTOU issues.
Is grsecurity still a thing? This kind of weakening should be a compile option, not enabled by default.
@emerajid commented on GitHub (Apr 21, 2024):
I have no clue about working with namespaces anyway, but if you expect anyone to look more closely at the issue, maybe you describe these issues in more detail? Maybe that will be helpful, because I have no idea how obvious are those TOCTOU issues to a competent developer.
I'm afraid I have no idea, but if you would make it a compile option, you'd have to mess with Makefiles, which is something I can't help you with. Besides, I have no idea how many more code honors grsecurity, so this may appear to be too big to belong here.
Anyway if you expect anything useful to be done to address this issue, you should invite somebody who has a clue. I have only been able to write this "solution" because it is of "Hello, World!" complexity.
@topimiettinen commented on GitHub (Apr 21, 2024):
Here's Wikipedia entry for TOCTOU.
Right, this was more of a side note, something to be fixed outside of this PR (unless it's indeed RUID which gives access).
Thanks for your contribution. Nice thing with Github etc. is that many solutions can be discussed before settling on one.