mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5246] google-chrome: real home is accessible with --private= (dbus) #2934
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#2934
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 @lukypko on GitHub (Jul 12, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5246
Description
google-chrome is able to access file list when using --private=FOLDER option
Steps to Reproduce
google-chrome-stable_current_amd64.debfrom https://google.com web pagedpkg -i google-chrome-stable_current_amd64.debmkdir -p ~/temp/youtube(can be any folder, but I used this one)cd ~/temp/youtubeps aux|grep -i chrom[e]|wc -l= 0firejail --private=$(pwd) --noprofile /usr/bin/google-chrome-stableCTRL+O(to open a file dialog)"Your file couldn’t be accessed,
It may have been moved, edited, or deleted.,
ERR_FILE_NOT_FOUND"
Expected behavior
When specify a command line option
--private=$FOLDER, then only files from a $FOLDER should be visible in a $HOME folder, "recently opened files should be only from $FOLDER (if there were some files opened previously)It looks like the issue is in "open file dialog" which have access to all files in my $HOME folder
Actual behavior
When specify a command line option
--private=$FOLDER, then all files from $HOME folder are visible in "open file dialog" and I can select a file. google chrome then display an error that file is not readableWhen trying to upload some file to virustotal, then file is uploaded successfully, but file size is 0 bytes (just to check whether it is possible read and upload a file using a javascript)
When open home folder as a URL in a google-chrome so
/home/lukyin my case, I see just expected content of my $FOLDER file, so this works correctly tooRunning without any profiles
Running using an existing profiles
--private=FOLDERAdditional context
Maybe it is related just to open file dialog and its caching, because when I click on a image file in "open file dialog" on a right side I see a small image preview. So it looks like that "open file dialog" is able to access file list and read file content to make a small image preview, but google-chrome itself cannot access a file content (as running with
--private=FOLDERcommand line option)firefox is using the same "open file dialog" and when I run:
then "open file dialog" in a firefox is not showing files from original $HOME folder, it is showing files from --private=$FOLDER, which is correct behavior
So it looks like that google-chrome is using "open file dialog" a different way and can escape from firejail container, which is wrong
Environment
kernel
Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
Output of
LC_ALL=C firejail --private=`pwd` --noprofile /usr/bin/google-chrome-stableOutput of
LC_ALL=C firejail --debug --private=`pwd` --noprofile /usr/bin/google-chrome-stable@rusty-snake commented on GitHub (Jul 12, 2022):
chromium* uses portals for it's file dialog.
Related/Duplicate of: #5032.
@rusty-snake commented on GitHub (Jul 12, 2022):
firefox: Set
widget.use-xdg-desktop-portal.file-picker=1onabout:configand you get the same.@lukypko commented on GitHub (Jul 12, 2022):
OK, I can confirm that when I set
widget.use-xdg-desktop-portal.file-picker=1in firefox, then firefox (immediately without a restart) is showing a content of $HOME folder, so behave exactly the same as in google-chrome.It works without a package
use-xdg-desktop-portalinstalled.So I guess, it is not a plan to support that in a firejail, actually "the application" cannot access file content, just the "file picker".
Some other links:
Support portals
https://forum.manjaro.org/t/browsers-like-firefox-require-xdg-desktop-portal-package-to-use-os-default-file-manager/106933
https://bugzilla.mozilla.org/show_bug.cgi?id=1285711#c31
https://forum.manjaro.org/t/set-nemo-as-default-filemanager/83387/8
@rusty-snake commented on GitHub (Jul 12, 2022):
see also #4716
@marcalia commented on GitHub (Nov 14, 2022):
I have the same problem with google-chrome running in firejail on debian 11 (xfce4) using the option --private=folder.
Trying to upload a file via the dialogue results in an error complaining about a 0 byte file.
Workaround:
Opening a file via file://... in the address bar, this shows the intended folder structure, and copying the address into the upload dialogue by opening the input filed via ctrl+l leads to a successful upload.
@wonbug commented on GitHub (Feb 24, 2023):
To pile on, I'm having a similar issue with google-chrome on Ubuntu 22.04.2 LTS. I confirmed it's running firejailed, yet the application is able to see the entirety of my disk, including the root directory. On a previous installation, it can only access the Downloads directory as one would expect. Do I need to take additional steps to limit what files Chrome can access?