-
Notifications
You must be signed in to change notification settings - Fork 36
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
Limit the filesystem to selected xdg portals #154
Conversation
* Improve sandbox security by change the "--filesystem" flag from "home" to "xdg-download". This means Signal can only access the XDG Download folder of the user instead of full access to home folder. * Resolve flathub#153.
Started test build 29472 |
Tested on my computer and found no issue. |
Build 29472 successful
|
Please help labeling this PR with the hacktoberfest-accepted tag. Thanks. |
What happens if I want to share an image with a contact? Without access to Home->Pictures, this will not be possible, right? |
I think the advantage of a sandbox application package (e.g. Flatpak) in the first place is to limit the security access of the packaged application. Allowing application to access the whole user home directory is quite an overkill if you simply want users to be able to share files from "Home > Picture". The documentations said you can specify
I'd propose to include all the common user file folders: xdg-desktop, xdg-documents, xdg-download, xdg-music, xdg-pictures, xdg-public-share, xdg-videos. That way other files in the root (especially vital directories like: .ssh, .config) are not exposed to the supposedly sandboxed application while still provide sufficient flexibility for file sharing. |
Adding all these directories might make sense. But if a user wants to send a file from another location which is not handled by xdg? Does is say that this application is "supposedly sandboxed" in regard to file access? |
There is always a struggle between usability and security. Usability is not always the priority, nor does security. Frankly, any filesystem access to an application imposes a security / privacy threat. The question is "what is the right balance for the specific application". I think if a user want to share any files from folder other than "Document", "Downloads", "Pictures", "Videos", "Music" and "Desktop" folder, it is always easy to copy or move the file(s) there before sharing. On the other hand, no user would want to compromise their SSH keys, security configs, VPN password because they simply wants to share files from other folder. I don't think that is the right balance. If usability is always the priority, why don't we simply give the application a "/" scope? There is always a possibility that I need to share my I think one of the main point to package an application with flatpak is to have every application's access to the OS limited. The applications permissions are limited so when it is compromised, no severe harm would come to the system, or the user's sensitive data. At least that's what it speaks to people when they labelled themselves "Sandboxed": |
Thank your for your lengthy description, you made a good point. I never saw this "Sandboxed" description and I wonder what it even means for this application with full home and network access. If you propose a PR, I'll approve of it when the aforementioned xdg portals are included, especially pictures, videos, and maybe documents. |
Extend filesystem permission scope to all these: * xdg-desktop * xdg-documents * xdg-download * xdg-music * xdg-pictures * xdg-public-share * xdg-videos
Started test build 29962 |
Build 29962 successful
|
Thank you very much. |
Many thanks! |
I think something must've gone wrong: I can no longer send files from any of the above-mentioned directories, however I can still send the |
I can partially verify this, however, did you look at the sent passwd file? It is the one from the sandboxed environment and not the host system. |
Oh, right. Sorry! |
Can you show us a screenshot of the filesystem browser in your send file process? |
Have you, by any chance, overwritten the sandbox values at some point? |
No, I haven't messed with my flatpak install in any way. |
@Maltimore I tried to reproduce the issue but can't. I started a new VM with QEMU and installed a flash copy of Kubuntu 20.04.1. Then I installed flatpak with apt. And installed Signal Desktop by clicking the "Install" button on the Flathub page. Here is what I got when I click "+" in a chat: To be sure, I created an empty test.txt in the user's Download folder. Then I tried to access it in the dialog. It appears normally: This looks to be a configuration issue. @Maltimore, is there anything I could have done differently to mimic your environment and reproduce the issue? Environment
|
@Maltimore: This is another attempt to reproduce the issue. Installed a KDE Neon 5.20.2 / 20.04 from their User Edition disc image (with flatpak already installed) in Chinese locale (i.e. default The Chinese folder names read:
Seems totally normal. P.S. I've also created a file in the Environment
|
Hi @yookoala |
Improve sandbox security by change the "--filesystem" flag from
"home" to "xdg-download". This means Signal can only access the
XDG Download folder of the user instead of full access to home
folder.
Resolve Filesystem access scope #153.