Skip to content
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

chromium: save location bypass and code execution #3968

Closed
happeeshopper opened this issue Feb 9, 2021 · 3 comments
Closed

chromium: save location bypass and code execution #3968

happeeshopper opened this issue Feb 9, 2021 · 3 comments
Labels
needinfo More information is needed from the issue author old-version Issues caused by using an old version of firejail stale Closed due to inactivity

Comments

@happeeshopper
Copy link

Bug and expected behavior

When using a Firejailed Chromium (default profile) it's possible to bypass the save location restriction and save files to desktop, or any other location, and to execute whatever file has been downloaded without any prompts.

  • What did you expect to happen?

For it not to be possible to execute the file.

Reproduce
Steps to reproduce the behavior:

  1. Launch Chromium without Firejail enabled and select 'Desktop' as the default save location.
  2. Close Chromium and re-launch Firejailed.
  3. Right click and 'save as' any .torrent/.txt/.pdf/.png/.jpg or other file to 'Desktop'. On checking 'Desktop' The file will not be saved, but...
  4. Click 'open' from Chromium downloads section and the 'non-existant' file will launch with the appropriate handler (Qbittorrent, Pinta, Imagemagick etc)

Environment

  • Linux distribution Xubuntu 20.04.2
  • Firejail version 0.9.62

Additional context
If the default system handler for the downloaded file is a snap package, then the file will be executed using the next available, 'non-snap' program instead.

eg: My default video player is VLC (installed from snap) but when I try this with a video file, the video opens with MediaInfo instead.

Also, even though the file isn't saved, if Chromiums save menu is opened again, Chromium file manager shows the file as being on the desktop.

The file can also being executed by entering the file path in the address bar. eg: filename is "pic1.jpg" and default save location is 'Desktop' so entering file:///home/user/Desktop/pic1.jpg in the address bar again executes the file.

I'm not sure if Firejail can prevent this, as the file isn't actually saved, but it doesn't seem right that the file is executed or that an alternate program is found when the default handler is an apparently un-usable snap.

@SkewedZeppelin
Copy link
Collaborator

SkewedZeppelin commented Feb 11, 2021

This is expected.
Default Chromium and Firefox profiles do not have private-bin set.

The file is indeed saved, it is however only in RAM and will be deleted on sandbox exit.

Not sure about the Snap part. Personally I'd remove that 😉 .

@glitsj16
Copy link
Collaborator

glitsj16 commented Feb 11, 2021

Please update your firejail package, the 0.9.62 version is vulnerable to this. You can use the PPA maintained by one of our collaborators if the official repo's you use are not (yet) updated. The current chromium profiles block access to ${DESKTOP}, contrary to those in 0.9.62.

Opening stuff with the system default launchers is considered a feature. If those launchers are themselves sandboxed by firejail they'll inherit the chromium sandbox options and might or might not work as expected. If you prefer to disable that feature you could blacklist /usr/bin/xdg-open.

+1 for NOT using snap (and flatpak for that matter). As our man page states they use their own sandboxing technology and are not supported.

@happeeshopper
Copy link
Author

I'm not a fan of snap myself, I'm doing a reinstall soon and wont be using it again. Ok np, I'll close this then.

@kmk3 kmk3 added old-version Issues caused by using an old version of firejail stale Closed due to inactivity needinfo More information is needed from the issue author labels Sep 4, 2024
@kmk3 kmk3 changed the title Chromium save location bypass and code execution chromium: save location bypass and code execution Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo More information is needed from the issue author old-version Issues caused by using an old version of firejail stale Closed due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants