mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3001] firejail --get and --put fail on filenames containing brackets #1879
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#1879
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 @JKjakay on GitHub (Oct 15, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3001
Hi, I am using firejail to sandbox firefox, and I love it! However, I have noticed a problem.
I'm running firefox with very restricted settings (--seccomp --private). So, in order to be able to retrieve downloaded files I use --get and --put to access the file within the sandbox. This works ok, except if the filename contains round brackets like "(" or ")", and maybe other special characters. I get an "invalid filename" error.
This happens with a filename like this:
foo(321).jpg
Escaping the illegal character wiith \ does not work. Using quotation marks also does not work: --get "/home/user/Downloads/foo(321).jpg"
Im using bash on Ubuntu 19.04. Regards JK
@JKjakay commented on GitHub (Oct 25, 2019):
Anybody got any ideas? I guess brackets may not work because there is no kind of filename expansion active with --put and --get. Probably for security, I think. But it still seems like a bug to me.
@smitsohu commented on GitHub (Nov 13, 2019):
I doubt you'll find a workaround, it is by design. Firejail rejects filenames if they contain certain characters.
@JKjakay commented on GitHub (Nov 13, 2019):
Thank you for clarifying this. It should be mentioned somewhere in the documentation (which is, sadly, not good). If you can use a filename as an argument, you would expect it to behave according to Posix standards.
@kodo-pp commented on GitHub (Jan 16, 2020):
I agree with JKjakay with regard to this issue: the restrictions on the filenames don't seem to fit right with POSIX standards and, without being mentioned in the documentation (at least I couldn't find anything about them in the manual page
man firejail), are quite surprising and counter-intuitive.From the security viewpoint, I don't see any benefit of deliberately restricting the set of characters used in filenames in the context of
--get,--putand--lsoperations (which are supposed to work with any filenames). Firejail just has to access the specified file, which should not treat characters like brackets or exclamation sign in any special way. (I hope Firejail doesn't use any unquoted shell magic for these operations, does it?)In fact, brackets are quite common in the filenames, especially of downloaded files, which often have names like
some important file (2).zip. Managing such files is a typical use case (I guess, at least what--get/--put/--lsare designed for), so I see disallowing the work with some commonly used characters in filenames is a misfeature which harms the usability.Also, I'm a bit surprised that there's been no action taken about this issue since November. Some discussion took place, but the issue wasn't resolved at all (it wasn't rejected or fixed in any way), so I wonder whether we can actually do something about it.
@smitsohu commented on GitHub (Jan 17, 2020):
@netblue30 ?
I am not able to comment on all aspects, just would like to emphasize that current Firejail is POSIX compliant in this regard:
https://pubs.opengroup.org/onlinepubs/9699919799/
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282
@rusty-snake commented on GitHub (Feb 22, 2020):
@smitsohu this is fixed by #3156, right?
@smitsohu commented on GitHub (Feb 24, 2020):
Kind of. Let's close it for now.