mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6637] Hardcoded iptables path causes issues on non-FHS systems like NixOS #3318
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#3318
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 @nakibrayane on GitHub (Feb 3, 2025).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6637
Description
Firejail has hardcoded paths to the iptables binary, which causes issues on non-FHS systems like NixOS. When running firejail with the
--netfilteroption, it fails to find the iptables binary and returns an error.Steps to Reproduce
nix shell nixpkgs#firejail)firejail --net=eth0 --netfilter curl --output /dev/null https://nixos.orgExpected behavior
Firejail should be able to locate the iptables binary and successfully configure the netfilter rules.
Actual behavior
Firejail fails to find the iptables binary and returns an error message:
This causes the netfilter rules to not be configured, and the curl command fails to resolve the host.
Behavior without a profile
Running
firejail --noprofile --net=wlo1 --netfilter curl --output /dev/null https://nixos.orgproduces the same error message.Additional context
The issue is caused by the hardcoded path to the iptables binary in the firejail code. On NixOS, the iptables binary is located at a different path. A more flexible way to locate the iptables binary, such as using the
PATHenvironment variable or a configuration option, would allow firejail to work correctly on non-FHS systems like NixOS.Environment
Linux 6.12.11 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 23 16:23:05 UTC 2025 x86_64 GNU/LinuxNixOS 25.05.20250201.3a22805 (Warbler)iptables v1.8.11 (nf_tables)firejail version 0.9.72Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
Output of
firejail --net=eth0 --netfilter curl --output /dev/null https://nixos.orgOutput of
firejail --debug --net=eth0 --netfilter curl --output /dev/null https://nixos.org@rusty-snake commented on GitHub (Feb 4, 2025):
There are more hardcoded paths that do not work well on nix.
Picking the first executable in
$PATHand executing it as root is a security vulnerability unless we set$PATHto something trusted like/usr/bin:/usr/sbin(i.e. hardcoding again).A
./configureoption is the way to go IMHO.OT: Sad that we decided against meson.