mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6360] Paths blacklisted using ${PATH} can't be unblacklisted using expanded paths (which works for other variables) #3248
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#3248
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 @smheidrich on GitHub (May 26, 2024).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6360
Description
Paths that are blacklisted using the
${PATH}expansion can't be un-blacklisted using--noblackliston the expanded path, which works fine for other variable expansions.Steps to Reproduce
/bin(as root):echo $'#!/bin/bash\necho ok' > /bin/some-executable && chmod +x /bin/some-executable${PATH}, then unblacklisting it via its unexpanded path, which works fine (but the order of CLI options has to be reversed for whatever reason - another option would be to do the blacklisting in a profile file):firejail --noblacklist='${PATH}/some-executable' --blacklist='${PATH}/some-executable', then runsome-executableinside the sandboxed shell; it runs fine.firejail --noblacklist='/bin/some-executable' --blacklist='${PATH}/some-executable', then runsome-executableinside the sandboxed shellExpected behavior
It should run fine as well.
Actual behavior
It reports a "permission denied" error because it's still blacklisted.
Behavior without a profile
The profile is irrelevant here because it's about rules for files we've just made up ourselves.
Additional context
The same thing works fine for other variables like
${HOME}, as well as for other expansions like wildcards.E.g. I can create a file
some-filein my home directory, and it doesn't matter whether I dofirejail --noblacklist='${HOME}/some-file' --blacklist='${HOME}/some-file'orfirejail --noblacklist='/home/smheidrich/some-file' --blacklist='${HOME}/some-file', in either case the file is accessible because it got unblacklisted successfully.It's seems like it's only
${PATH}that behaves inconsistently with the other expansions.This was first noticed while drafting #6359, which aims to improve the manpage. If this inconsistency isn't considered a bug, then it should definitely be mentioned in the manpage. It also breaks the current
--noblacklistexample, which tries to unblacklistncusing its expanded path.Environment
Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)N/A - [ ] I'm aware of
browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)