mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2665] Malware can bypass host's firewall using firejail --net=... #1678
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#1678
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 @dandelionred on GitHub (Apr 25, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2665
Hey guys! I'm slightly :) paranoid mby but still.
Setup:
This way my external traffic either goes into tun0 or goes nowhere in case the openvpn connection dies whatever the reason, so my real external ip is never leaked.
Firejail present on my system opens an attack vector for malware to leak my real ip like this:
(because the newly created network namespace is absolutely independ of the host's network namespace were my firewall rules exist)
Basicly, it doesn't mean how much restrictive the host's firewall is, malware can bypass it if only it can exec firejail (=firejail is present and the user is allowed to use it).
Another point of view: the recommended way to sandbox x11 unintentionally ignores the host's firewall
Btw
--netis not a must to disable the abstract x11 sockets. With this https://tstarling.com/blog/2016/06/x11-security-isolation/ I successfully shut those down in ubuntu 14.04:/etc/lightdm/lightdm.conf.d/50-X-no-listen.conf
Is it possible to disable the "--net" feature at all at compile time?
@SkewedZeppelin commented on GitHub (Apr 25, 2019):
This is already supported: uncomment and set
restricted-networktoyesin/etc/firejail/firejail.config. It is actually the default in Debian packages, see https://sources.debian.org/patches/firejail/0.9.58.2-1/config-hardening.patch/at that point, you're already compromised anyway
Off-topic: instead of relying on fragile iptable rules to ensure your routing, consider using Qubes+Whonix or Tails
@veloute commented on GitHub (Apr 26, 2019):
if malware on your system can run arbitrary commands, you've already got a much bigger problem than them getting your real ip address.
@dandelionred commented on GitHub (Apr 26, 2019):
@SkewedZeppelin
I compiled it myself. Thanks for the tip, I'll use the config option.
I don't share your point of view. Thinking in terms of "compromised anyway" it would be OK having passwordless sudo.
@veloute
Do you use passwordless sudo?
@veloute commented on GitHub (Apr 26, 2019):
see https://xkcd.com/1200/
@dandelionred commented on GitHub (Apr 26, 2019):
@veloute
There is a big flaw in the comic: you have to have friends for someone to impersonate to.
Joking aside, the comic (while still hitting some point) is poor minded
@chiraag-nataraj commented on GitHub (Apr 26, 2019):
This is why you don't remain logged in and make it easy to revoke authorization for programs that are logged in. For example, I run
fetchmail, but it has its own app password which I can then revoke should the need arise.Unfortunately, I end up remaining logged in to a bunch of chat services (Messenger, Slack, the like), but I can easily kick the computer off of those services should the need arise as well,
So yeah, the comic isn't really all that valid.
@veloute commented on GitHub (Apr 26, 2019):
i see your point - it probably isn't the best example but was the best one i could think of at the time.
a better example of the point i was trying to make was maybe https://en.wikipedia.org/wiki/Principle_of_least_privilege
essentially, what i was trying to say is that a process doesn't necessarily need to have elevated privileges to wreak havoc for a user and cause all kinds of damage - generally speaking, most users have quite a lot of important documents stored in a regular, user-accessible directories.
if a process can run arbitrary commands on a system, they can, for example:
from the op:
it's a lot harder to stop malware from doing things once it's in, that's why we take precautions so it can't get in the system in the first place.
firejail is essentially an answer to that problem. if a process is isolated using firejail, it wouldn't be able to do the command first mentioned, so i'd argue the problem is moot.
@dandelionred commented on GitHub (Apr 26, 2019):
Check this out:
So it is pretty possible to have malware installed by just upgrading some application from pip/npm.
After all, I'd like to take back my thoughts about the horrible possibility for malware to leak my ip by means of firejail --net.
I'd even say more: it doesn't matter much if your sudo is passwordless or not on a generic xorg desktop (not speaking about qubes). As only malware can run anything under the user, in can either use the passwordless sudo OR keylog with xinput until you enter the password. Some creepy details: https://security.stackexchange.com/a/119420
@dandelionred commented on GitHub (Apr 26, 2019):
Back to the stolen laptop story: you're not safe even in case you have the screen locked the stock way. That's why this exists https://github.com/google/xsecurelock
@chiraag-nataraj commented on GitHub (Apr 26, 2019):
I mean, yeah. Just like it's possible to get malware on Windows by downloading random applications. I really don't see a difference here.
As for the other stuff, I'm not quite sure what your point is. Yeah, X11 is insecure - I feel like many people here already know that. We can try to use X11 isolation through
firejail(using eitherxpraorxephyr), but everything's imperfect.And yeah, all those environment variables are both useful and dangerous - one does not preclude the other.
firejailstrips many environment variables out of the environment passed to the child process, so that helps a bit.I guess, fundamentally, I'm not quite sure what your point is anymore.
@smitsohu commented on GitHub (Apr 26, 2019):
Regarding the original issue, I still wonder if there could be another way than disabling the networking features altogether.
For example, it might be possible to save the current ipfilter configuration into a file before the sandbox process is created, and then always apply this firewall in the new net namespace. This could be made configurable in firejail.config.