mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #475] mpv unable to use youtube-dl with icecat profile #337
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#337
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 @dirtybytes on GitHub (Apr 22, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/475
Recently (it started no longer than two weeks ago, probably less than one) I've been unable to use play-with-mpv add-on from within firejailed icecat. It worked fine for as long as I can remember, but not anymore. It looks like mpv is started, but is unable to use youtube-dl for some reason and so quickly fails, as revealed from the console:
It works fine though when starting without specifying the profile.
@Fred-Barclay commented on GitHub (Apr 22, 2016):
What happens when you don't specify the profile? (Please show the terminal output.)
Do you perhaps have a custom profile in ~/.config/firejail/ ?
@liloman commented on GitHub (Apr 22, 2016):
Hi,
I was going to report exactly the same but for firefox. :D
I've been using firefox and youtube-dl since I started using firejail and It was working nice since the last commit 2 months ago, today I have update firejail to last commit and suddenly youtube-dl stopped working.
The issue is that /usr/bin/python3 is blocked by default in disable-devel.profile, so It stopped working because last week It was blacklisted in this profile.
I've tried using noblacklist after including the profile without luck.
So I have 2 question:
1-How can you whitelist just python for youtube-dl or at least for firefox?. :S
2-I don't know why BUT my journalctl is reporting me many blocked attempts to the whole devel enviroment from firefox since I started using firejail. Is that a common issue or O_o??
The logs look like this:
EDIT: To add log
Cheers and thanks.
@dirtybytes commented on GitHub (Apr 22, 2016):
Here's the output after watching for three seconds and quitting. And no, I don't have any custom profiles in my home directory.
@Fred-Barclay commented on GitHub (Apr 22, 2016):
Yes, I was the one who blacklisted python2 and python3. Sorry about the trouble--it's going to take a bit to find all the programmes that require python3. :)
@liloman : the logs are because tracelog is enabled in the firejail profile. That's good. What is gdb?
@dirtybytes : apparently icecat.profile includes disable-devel.inc, while the mpv profile doesn't. Let's try noblacklisting python3.
firejail --noblacklist=${PATH}/python3* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYwI personally am not comfortable with removing python3 from the blacklist (though of course any decision on what to do is ultimately @netblue30's). Python isn't a common attack vector--nothing as bad as java--but it's still a concern of mine.
I'm not exactly sure how to write a profile for an add-on. Would you do some experimenting if I hack a profile together?
@Fred-Barclay commented on GitHub (Apr 22, 2016):
Oh--one more thing. Are all of you on firejail 0.9.40~rc2?
firejail --version@dirtybytes commented on GitHub (Apr 22, 2016):
$PATH is actually a list, so I'm not sure if you can do stuff like ${PATH}/xyz. Tried this instead:
Sure, I can try different profiles. If you can't find a solution that doesn't involve whitelisting python, it's probably not a good idea to merge the changes into the main branch, but it would still be nice to know what you can do for a custom profile if you're willing to put up with additional risk for some convenience.
Version is the very latest, cloned from github and compiled from source.
@Fred-Barclay commented on GitHub (Apr 22, 2016):
Good, that's the same version I have (I build from source every day).
You're right about ${PATH}; I don't know what I was thinking. :)
You seem to need the python libraries as well. At the moment I'm not entirely sure if it's python2 or python3, so keep on enabling both of them.
Try this:
firejail --noblacklist=/usr/bin/python* --noblacklist=/usr/lib/python* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYw@dirtybytes commented on GitHub (Apr 23, 2016):
Yep, works that way. I guess I'll have to add this to a modified profile unless someone can figure out a better solution.
@Fred-Barclay commented on GitHub (Apr 23, 2016):
Wait--first let's find out a few more. Can you run each of these and tell me what you get?
firejail --noblacklist=/usr/bin/python2* --noblacklist=/usr/lib/python2* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYwfirejail --noblacklist=/usr/bin/python3* --noblacklist=/usr/lib/python3* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYw3.
firejail --noblacklist=/usr/lib/python2* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYwfirejail -noblacklist=/usr/lib/python3* --profile=/etc/firejail/icecat.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYwI'll handle the (experimental) profile if you like. :)
@dirtybytes commented on GitHub (Apr 23, 2016):
The second one worked, the rest produced same error as in original post.
Sure, if you want, but it seems like simply adding two "noblacklists" and including the standard icecat profile would do the trick.
@Fred-Barclay commented on GitHub (Apr 23, 2016):
Can you try this as a profile (save as mpv.profile):
So, something like
firejail --profile=/path/to/mpv.profile mpv https://www.youtube.com/watch?v=IVpOyKCNZYw@dirtybytes commented on GitHub (Apr 23, 2016):
Yeah, starts the video without a hitch. Only, as I understand it, the player would still be jailed under the same profile as the parent process, unless you could have it called with a different one somehow.
@Fred-Barclay commented on GitHub (Apr 23, 2016):
That's where I'm a bit fuzzy. Your original post said that you had trouble with mpv inside icecat, but you've always started mpv separately (at least, that's what it looks like from here). What happens if you use mpv inside icecat?
First move the mpv.profile to
~/.config/firejail/.@dirtybytes commented on GitHub (Apr 23, 2016):
Of course it wouldn't work. It does work when saving as firefox.profile instead, but then again, this is effectively reverting the python blacklist change, so it probably should be left as is, unless you can think of a better solution.
@Fred-Barclay commented on GitHub (Apr 23, 2016):
So a temporary fix would be to copy the existing icecat profile to ~/.config/firejail, and then add these two lines at the beginning:
(for @liloman , copy and modify the firefox profile instead).
I'm not sure how I feel about removing python3 from the blacklist in etc/disable-devel.inc, though. After all, icecat/firefox itself doesn't require python3, only an addon, so we'd be opening a risk for all users to allow for an addon used by some, if we removed the blacklist. @dirtybytes, I think you agree with this, from what I've read?
Maybe @netblue30 will chime in; if not, I'll think on it for a few hours and get back with you.
Sorry for the trouble!
What would be really convenient, would be if firejail could detect if you were running a certain plugin, and then and only then include the relevant profile.
@dirtybytes commented on GitHub (Apr 23, 2016):
Yes, I definitely agree; however, I wonder if it would be possible for mpv to start with its own profile if it's detected. This way, you could have a tigher security profile for your browser, but a more lax one for your player, which probably isn't likely to get exploited.
@Fred-Barclay commented on GitHub (Apr 23, 2016):
Is this the add-on you use?
https://addons.mozilla.org/en-US/firefox/addon/watch-with-mpv/
@dirtybytes commented on GitHub (Apr 23, 2016):
That's the one.
@liloman commented on GitHub (Apr 23, 2016):
Working now I needed to add the * after python3.
So the remaining question is how to disable python for firefox/icecat/whatever and allow it for a internal plugin??
@liloman commented on GitHub (Apr 26, 2016):
Related to the question I think It would be nice something like:
noblacklist /usr/bin/python3* -> /usr/bin/youtube-dl
or to not tamper with current implementation:
noblacklistfor /usr/bin/python3* /usr/bin/youtube-dl
Meaning that you shouldn't block python3 for youtube-dl for that profile. I reckon it shouldn't "be hard" to implement and I think it's something that would be necessary sooner or later alike to security frameworks as selinux (transitions,...).
@netblue30 commented on GitHub (May 1, 2016):
moved to: https://github.com/netblue30/firejail/issues/484