mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2029] Possible conflict with noexec and whitelist #1367
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#1367
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 @Fred-Barclay on GitHub (Jul 5, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2029
Related to #839 and #1628, but this doesn't require
read-onlywhile they do.noexecto a parent directory, but without wildcards. For example,noexec ${HOME}.noexec.For example, I've created ~/Desktop/test.sh with the following contents:
~/Desktop/test.profile:
It's being executed when I run it in firejail:
Order of operations doesn't matter either -- putting
noexec ${HOME}before the whitelist still allows execution.There are a few ways to keep the file from being executed. Using wildcards prevents execution;
noexec ${HOME}/Desktop/*andnoexec ${HOME}/*/*both work in this case, althoughnoexec ${HOME}/Desktop/allows execution.Also,
noexecworks as expected if there are no whitelists in the sandbox (or, naturally, if the executable isn't whitelisted).EDIT:
--debugoutput:@chiraag-nataraj commented on GitHub (Jul 15, 2018):
I wonder if this is intended behavior. What exactly should the behavior be if you whitelist a binary and mark a parent directory/mount point noexec? Should the binary run and violate noexec or not run and defeat your intent? Clearly, if you are whitelisting an executable file, you want to run it (otherwise, there's no reason to whitelist it). So while on the face of it it seems counterintuitive, I think this behavior actually makes some logical sense.
@chiraag-nataraj commented on GitHub (Jul 15, 2018):
Now my question is if you whitelist an executable file which creates another executable file and tries to run it, will that second file run? I'm off to test.
@chiraag-nataraj commented on GitHub (Jul 15, 2018):
Awesome, this works as intended: the second script is prevented from running.
Here's
test.sh:As you can tell, the second script can't run due to the
noexecon the parent mountpoint.@chiraag-nataraj commented on GitHub (Jul 15, 2018):
So basically,
noexeccan be more understood as "Don't run anything unless I explicitly whitelist it" rather than a blanket "Don't run anything". This actually makes for a decently flexible jail, since you can basically not allow arbitrary binaries to run while whitelisting ones you trust.@Fred-Barclay commented on GitHub (Jul 16, 2018):
@chiraag-nataraj it would be nice to know if this is intended behavior -- we should probably document it if so. I'm not convinced it makes sense but I do see what you're talking about. 😉
@chiraag-nataraj commented on GitHub (Jul 16, 2018):
Tagged it with both - that way, we can remove whichever one doesn't apply 😉
@chiraag-nataraj commented on GitHub (Aug 21, 2018):
@netblue30 Is this a bug or is this desired behavior?
@smitsohu commented on GitHub (Nov 26, 2018):
moving the discussion to #2200