Skip to content
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

mkdir command works even when the path is blacklisted #6447

Closed
elde-n opened this issue Aug 23, 2024 · 4 comments
Closed

mkdir command works even when the path is blacklisted #6447

elde-n opened this issue Aug 23, 2024 · 4 comments
Labels
notabug The behavior is as intended or the issue was caused by user error or by an old version

Comments

@elde-n
Copy link

elde-n commented Aug 23, 2024

The mkdir command in a profile file bypasses nowhitelist and blacklist override

Example:
test.local

nowhitelist ${HOME}/test
blacklist ${HOME}/test

test.profile

mkdir ${HOME}/test
@rusty-snake
Copy link
Collaborator

It does not bypass them because it can not "bypass" them. You can not protect firejail from firejail with firejail.

So what's going on

nowhitelist ${HOME}/test
mkdir ${HOME}/test

Firejail sees two commands, one asking to ignore any following whitelist ${HOME}/test command. And one command asking to create a directory at ${HOME}/test.
One could say mkdir should respect a nowhitelist like it should for --private= (which has a bug and does not respect --private=). But see the next.

blacklist ${HOME}/test
mkdir ${HOME}/test

Firejail sees two commands, one asking to blackist ${HOME}/test if it exists. And one command asking to create a directory at ${HOME}/test.
While this order isn't very useful, flipping these two lines can make a different between a sandbox escape and blocking it.

@rusty-snake rusty-snake closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
@rusty-snake rusty-snake added the notabug The behavior is as intended or the issue was caused by user error or by an old version label Aug 23, 2024
@elde-n
Copy link
Author

elde-n commented Aug 23, 2024

Well how would I avoid calling mkdir in a default profile?
For example the default neomutt profile creates 6 trash directories in the home directory that are never used on my system

@rusty-snake
Copy link
Collaborator

Add ignore mkdir <PATH> to your neomutt.local.

@elde-n
Copy link
Author

elde-n commented Aug 23, 2024

Thank you it's exactly what I was looking for!

@kmk3 kmk3 changed the title Issue with mkdir command mkdir command works even when the path is blacklisted Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notabug The behavior is as intended or the issue was caused by user error or by an old version
Projects
None yet
Development

No branches or pull requests

2 participants