mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3357] No warning or error if a file or directory does not exist #2108
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#2108
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 @rdiez on GitHub (Apr 15, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3357
The following command prints no errors or warnings:
firejail --noprofile --read-write=/does/not/exist --read-only=/does/not/exist sh -c "echo a"This makes using Firejail rather brittle. You will tend to miss errors in your scripts.
I think that specifying a path which does not exist should fail straight away.
A file glob expression that matches no files or directories should at least generate a warning. Compare with the "rm" command, which fails immediately:
I have tested this issue with the latest Firejail release version 0.9.62. I am using Ubuntu 18.04.4 LTS, so that new version came from the Firejail PPA.
@rusty-snake commented on GitHub (Apr 15, 2020):
The issue here are all the disable-*.inc files.
Consider
You will either need to spam your home directory, or comment every thing and forget to uncomment when you need it.
You can use
mkdirandmkfileto create paths.@rdiez commented on GitHub (Apr 15, 2020):
What you describe is the "normal user" scenario that just types "firejail firefox" and relies on profiles.
Firejail's tendency to ignore non-existent paths is problematic in that scenario too. Say the path changes in Fedora or Ubuntu. Nobody will realise that some path is no longer blacklisted. That makes a security tool like Firejail unreliable.
But I am also thinking about other usage scenarios:
@rusty-snake commented on GitHub (Apr 17, 2020):
You can use
--debug,--debug-blacklists, ... to be sure your path is blacklisted/read-only.@rdiez commented on GitHub (Apr 17, 2020):
That does not really cut it. Nobody should be expected to use debug flags to get a warning or an error when a specified path does not exist. Besides, debug flags tend to be too noisy for everyday usage.
@rusty-snake commented on GitHub (Apr 17, 2020):
Do you have a suggestion how this should look like then? hardfailing if a blacklist path does not exist and removing disable-progams.inc, disable-common.inc, disable-xdg.inc, disable-devel.inc and disable-interpreters.inc isn't a solution. This would decrease the security.
@rdiez commented on GitHub (Apr 17, 2020):
I recently wrote some ideas about a related issue here .
User smitsohu also suggested something like fatal-warnings .
@rusty-snake commented on GitHub (Apr 17, 2020):
For the warnings (e.g. noroot) this makes sense. But I doesn't see a advantage of a error-on-non-existing option since it will fail as long as you include disable-common and co.
@rdiez commented on GitHub (Apr 17, 2020):
Like I mentioned before, you could implement something like "ignore-errors" (or "ignore-non-existing-paths") as an option that is only in effect for the profile it is in.
Or maybe the reverse, some "strict" command-line option that affects anything afterwards.
The goal is to have a way to run "firejail --noprofile --strict ..etc...", so that you can really be confident that anything you ask for, and every path you specify, is enforced, checked, etc.
Otherwise, one day some hacker is going to slip through the protections, and in the security advisory you will find a comment like "Firejail silently ignored a misconfigured / buggy option that would have saved the day, but that problem was undetected for years". And then it is not going to look very professional on your side... }8-)
@rusty-snake commented on GitHub (Apr 17, 2020):
In combination with
--noprofileit maybe makes sense. I understood that above that firejail should error by default on that.