-
Notifications
You must be signed in to change notification settings - Fork 595
Firefox warning message about user namespace after upgrade to AppArmor 4 #6675
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
Comments
I think a discussion is in order if it is truly 'secure' or 'desirable' to give a browser access to userns. Examples are available where those namespaces are subject to privilege escalation attacks. |
Firefox's internal sandbox is much stricter than the theatre firejail applies.
Of course more permissions is less secure. If you would deny network access for your browser it is much more secure, but some things are necessary. And granting userns is more secure than breaking the internal sandbox. |
Probably comparing 🍎 with 🍊
That is your opinion, don't state as fact please. But I invite you to elaborate on the why, by providing reasons to weaken the outer sandbox for the benefit of the internal one. |
50%, it also protects the host from the web content. You can not protect the horizontal path without protecting the vertical path.
TL;DR: The internal sandbox isolates the most dangerous part, web-content (Untrusted input and untrusted code (JS/Wasm) processed by an unsafe language), in a strict sandbox. The outer sandbox is already weaker and has more escape vectors. So what are the reasons to block user namespaces:
So attack surface reduction. What looks the overall attack surface of firefox.profile like? Huge. So you ask for the reasons to allow it:
|
@rusty-snake thanks for your effort in explaining userns and the inclusion of flatpak in your comparison. However I am still not convinced Firefox is the best candidate App to allow userns for, as it can come in direct contact with some very unsavory sites and therefore poses a real risk to the containing system if it were to be allowed to execute elevated/root actions (even within the sandbox!) as it now comes in direct contact with the kernel. Furthermore just a couple of days ago no less than 3 userns vulnerabilities were published. And I guess more can be expected. https://www.qualys.com/2025/three-bypasses-of-Ubuntu-unprivileged-user-namespace-restrictions.txt So I am still inclined to have especially and specifically Firefox remain a dumb 'regular user' app without the possibility to create sandboxes of its own. I hope more people can chip in and give points of view. |
Well, these are vulnerabilities in the userns blocking of Ubuntu. Going into that a bit, Ubuntu tries to block userns by default for all programs and then transitions from blocked to allowed. Something like this is incredible difficult to be done right. I'm not deep in AppArmor so I can not explain in depth here, but to give na practical example: Ubuntu allows userns creation in the AA profile of flatpak (technical requirement of flatpak/bwrap). However, flatpak isn't designed to "isolate" this permission. Meaning if a program is not allowed to create userns but is allowed to |
...AND after that allow an unprivileged user to gain full administrative capabilities within a user namespace. So just the fact there are CVEs trying to circumvent ubuntu's user namespace restrictions would mean in my book that not having these restrictions at all (like in debian or arch) is just naïve. But OK, let's assume that even with administrative permissions in the sandbox the system is still 'safe' as long there is no kernel exploit to escape the sandbox. Is there a way that the system, while also using firejail, can apply the specially crafted AA FF profile instead of the |
(Still replying in context of #6675 (comment)) Let's talk a bit about sandbox architectures. There are fundamental two approaches for sandbox architecture: wrapper sandboxes and broker sandboxes. Of course there are hybrid concepts, sub-approaches, …. A wrapper sandbox sets up a confined environment and hands off control to the sandboxee. A broker sandbox (in it's strictest form) starts the sandboxee in an empty environment with only cpu time, memory and an IPC interface to the broker (seccomp mode 1 is an example of a very strict implementation). Every impure operation/access must go through the broker. firejail falls into the wrapper sandbox category. The greatest advantage of a wrapper sandbox is that it can be applied to every code because it needs zero cooperation of the sandboxed code. The greatest disadvantage is that it need to grant every permission any module of the sandboxed code could ever need. A broker sandbox on the other hand can perform runtime checks and grant/revoke permissions only to/from specific modules, at specific times, after user consent, …. And if the sandboxed code cooperates with the broker, it can assign different trust levels to different modules / provided sandboxed APIs. That being said means that the internal sandbox of Firefox/Chromium/…, which is broker based, can
i.e. the internal sandbox is in the better position. First because it can draw the line between Firefox-UI/ |
Great write-up, much appreciated! Reading all this makes me appreciate the double sandbox (wrapper (by FJ) & broker (within FF) even more. My question was about where AppArmor (AA) comes in to play and if it was possible to redirect the wrapper sandbox to use the AA profile for the specific App being used. Then we would have the best of three worlds (outer FJ sandbox with child (FF) AppArmor restrictions AND the internal FF sandbox) |
I'm on a SELinux system for years now and have not much contact points to AA so I can not help very much here. Nevermind, you should have a look at the firejail manpage for |
Ok so I found out using AA and FJ together is pretty awkward and not generally a good idea. So ideally (if I put things together right) we would need a custom Especially the apparmor profile creation and maintenance I am not looking forward to, but if someone has a baseline for both that could work, that would be awesome. Suggestions are appreciated! |
For me on Arch Linux with system wide enabled Unprivileged User Namespaces (
With that configuration there should be full Firefox sandboxing within Firejail/AppArmor with the downside of maintaining kernel attack surface via Unprivileged User Namespaces. Sadly (at least to my knowledge) there is no way to disable Unprivileged User Namespaces ( The Arch Linux Wiki says there is an discouraged |
Ok so I think we can conclude there is no way to allow userns for a specific app only. You either open it up system wide or you don’t. Then the other way to allow userns (besides the one @duckduck1 describes) is just to add I think I personally prefer this method (ie. having firejail control userns usage) to the kernel setting method. But if someone has great arguments to prefer the later please enlighten. |
If this is an issue for the other applications, I'm wondering whether firejail could have 2 default AA profiles (but this is a bit more complicated): one with |
Description
Since the upgrade to AppArmor 4 on Debian/unstable, Firefox displays the following warning message: "Some of Firefox's security features may offer less protection on your current operating system."
And there is a link to https://support.mozilla.org/en-US/kb/install-firefox-linux#w_security-features-warning
In particular:
So the Firefox AppArmor profile has
userns
to allow user namespaces.The issue is that with Firejail, the AppArmor profile is
firejail-default
, not the Firefox one, thus it does not haveuserns
.Steps to Reproduce
Run
firejail /usr/bin/firefox
and continue until a Firefox browser window is open.Expected behavior
The Firefox window should not show a warning message.
Actual behavior
The following warning message is shown above the main area: "Some of Firefox's security features may offer less protection on your current operating system."
Behavior without a profile
What changed calling
LC_ALL=C firejail --noprofile /path/to/program
in aterminal?
There is no warning message. But I suppose that this is because the
firefox
profile uses AppArmor (which is probably wanted), according to the contents of thefirefox-common.profile
file:while this is not the case without a profile.
Additional context
My Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098869
This may be similar to #6368 for Chromium.
Environment
uname -srm
):Linux 6.11.10-amd64 x86_64
mesa 1:24.3.3-2"): Firefox 135.0.1
firejail --version
): 0.9.72Checklist
/usr/bin/vlc
) "fixes" it).https://github.com/netblue30/firejail/issues/1139
)browser-allow-drm yes
/browser-disable-u2f no
infirejail.config
to allow DRM/U2F in browsers.Log
Output of
LC_ALL=C firejail /path/to/program
Output of
LC_ALL=C firejail --debug /path/to/program
I can see in particular:
and
I can provide the full output if needed.
The text was updated successfully, but these errors were encountered: