-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NOT SURE IF BUG] multiple instances of same application started via "firejail --private $PROG" not isolated but share data #4206
Comments
There's some confusion here. Both issue title and the above issue description seem to suggest you are seeing this behavior with all applications. Yet IMO this is mainly focussing on firefox, which has a set of parameters of its own, like To be clear, can you provide another example of an application that shares data besides running multiple firefox instances? On a side note, we have discussions too now, so when unsure if you have a bug, might be more appropriate to open a discussion thread instead.
Hard to answer. It's always good practice to get familiar with the ins and outs of the applications you want to sandbox. In this case I'd suggest running |
Hey, thanks for your answer. Yes, I'm atm only seeing this behaviour with firefox, which obviously doesn't mean it's only happening with firefox. Since you're using the term "sandboxing" yourself, I have to admit I indeed would expect an application being sandboxed/jailed, it being isolated to a degree that above described behaviour is /not/ happening when sandboxing it with the most restricting option the sandboxing suite provides me with (in this case As you're saying it's not firejail but firefox, I have to assume firejail is not sandboxing the applications I'm using firejail on to the degree I expected firejail to do. Don't get me wrong, I'm not blaming / fingerpointing here and quite well understand what's happening on the technical level here, but it seems I used firejail with wrong assumptions, mainly, that the processes are being isolated from each other and only share a bare minimum of resources necessary for their basic functionality (audio, video on the higher level, potentially a couple of sockets (e.g. dbus, etc.) on the lower level), but do not do IPC / expose such data to unrelated processes (*). And I'm kind of afraid it's not only me having this assumption. (*) I know that in this very scenario it's not "processes" but one single process and calling |
As @glitsj16 pointed out, something worth trying would be to start Firefox with Firejail could set the MOZ_NO_REMOTE environment variable also automatically. In fact it's already in the source, it just was never uncommented. Not sure about the reason, but I suppose it's because this behaviour is (or used to be) quite convenient when opening links in email clients. Line 123 in 6b4f6f4
|
Maybe we need some kind of OSD-notification system to inform users of these kinds of potential issues/unexpected behaviours. It's fine to have error and warning messages in the code, but you need to be in a terminal starting apps from CLI with --ignore=quiet to catch any of this, let alone understand what's being communicated. And allthough we don't have data on how people use firejail on a daily basis, I think it's pretty safe to assume a 'regular' user is GUI-oriented. Quite a complex topic all in all. But it never hurts to contemplate improvements... |
@mirko If you wonder how to interrupt the IPC by means of sandboxing, you may want to give Firejail's |
@smitsohu I'm wondering if MOZ_NO_REMOTE (and potentially other) environment variables could be moved from the code to the profiles themselves. Or at least also included in (some) profiles, so users would be more aware of their relevance. Any thoughts on that? |
Given I'm running wayland and using firefox natively within wayland ( |
Just for clarification, what - on technical level - makes firefox actually detecting there's already an instance running and hence deciding to communicate via what exactly with the first instance so it triggers the opening of a new window there? SHM? D-Bus? Some (other kind of) socket? |
Ok, then we have a new issue 😃
Looks like they are using D-Bus on Wayland. |
@glitsj16 That's an interesting idea. It should be possible at least for those environment variables that don't have to be computed. And maybe excluding KDE_FORK_SLAVES because it has small security implication on its own (controls if code runs inside or outside the sandbox if D-Bus is not disabled); so in this case |
@glitsj16 @rusty-snake Probably you are right, it is more an issue in Firefox.
How about adding the FAQ as a comment to the profile? The setup suggested in the FAQ though still leaves the possibility of lesser trusted Firefox instances (say an online casino profile) messing with more trusted instances (say an online banking profile) at filesystem level, because all instances whitelist the same ~/.mozilla directory. Strict isolation would require something like
all of which doesn't fit well in a default profile. |
I actually set this up, along with a mechanism for generating temporary Firefox profiles (cleaned on exit), using my private-profile.sh and this configuration file. @mirko, you may be interested in that script. Because I store all of my profiles in |
I'm closing here due to inactivity, please fell free to request to reopen if you have more questions. |
I'm starting a firefox instance explicitly via
firejail --private firefox
and start browsing.Then I'm starting a second firefox instance again via
firejail --private firefox
while the first one is still running.A bit confused I noticed, that while typing an URL it autocompletes to sites I browsed in the first instance.
Bug and expected behavior
Describe the bug.
The instances started via
firejail --private $PROG
(in my case PROG=firefox) are not isolated from each other and share data.What did you expect to happen?
Every instance of $PROG started via
firejail --private
being fresh and isolated from other instances.No profile and disabling firejail
firejail --private --noprofile firefox
in a terminal?nothing
Reproduce
Steps to reproduce the behavior:
firejail --private firefox
firejail --private firefox
and access data stored by instance started in (1)Environment
lsb_release -a
,screenfetch
orcat /etc/os-release
)firejail --version
) exclusive or used git commit (git rev-parse HEAD
)firejail version 0.9.64.4
If it's not a bug, on a scale from 1 to 10: how silly is it me being surprised by this behaviour?
The text was updated successfully, but these errors were encountered: