Description of problem:
xdg-open can be told to open an application launcher (.desktop file) that is not "trusted" (marked executable). xdg-open will launch the application from this file anyway.
Graphical desktop environments like Xfce/Thunar, on the other hand, will not execute an untrusted application launcher. Instead, double-clicking it will result in a warning prompt explaining that the launcher is not trusted and giving options to mark it executable, launch it anyway, or cancel.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create an application launcher .desktop file, and make sure it is NOT executable (chmod -x)
2. Run `xdg-open test.desktop` to launch your file. See that it runs.
3. Open Thunar on an Xfce desktop (haven't tested with Nautilus), and double-click on the .desktop file. See that it resists launching it.
4. Mark it executable with `chmod +x test.desktop`
5. Double-click it in Thunar and see that it executes now with no prompt.
xdg-open will run the application launcher even though it is not marked executable and is not "trusted" by a graphical desktop environment.
xdg-open should refuse to launch a non-executable application launcher and give an error message indicating that the launcher must be made executable.
Demonstration video of a proof of concept exploit that has this as the root cause: https://www.youtube.com/watch?v=gjyJj1RJAYY
Example application launcher (will launch gedit):
Under what circumstances will xdg-open execute such an (untrusted) application launcher? (other than explicitly and manually doing it?)
As in the linked YouTube video, you can send somebody a file:// URL in Pidgin which becomes a clickable link, and it could point to an untrusted .desktop file that then gets launched when clicked.
1. Send a user a link that downloads a .desktop file (Chrome/Chromium will automatically download it without prompting)
2. Send the user a file:// link to the downloaded .desktop file, which has a predictable file path on disk.
If instead the user attempted to navigate to and double-click the .desktop file, they would be warned about it being untrusted and they need to confirm if they really want to execute it. When clicking a file:// link, they don't get any such warning.
This may be DE-specific.
For example, if I do:
on kde/plasma, it opens an editor for the .desktop file (and does not execute it).
on kde, xdg-open uses 'kde-open'
On XFCE, xdg-open uses exo-open, and indeed,
launches the app, and sure enough, if I copy that .desktop file locally (without execuate bit), exo-open still opens it without fuss.
Reassigning -> exo-open
Sadly it seems there was no changes made to the actual spec around calling non executable desktop files 'untrusted', it's just something some groups choose to do. ;(
I can file a bug upstream asking for that... or would you prefer to do so?
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 21 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.