.desktop file extension on Linux should be rewritten to .desktop.download to avoid users running local executables _if_ desktop files are executed by the user's file manager.
Firefox on Linux downloads .desktop files without renaming them to .desktop.download, unlike the protection applied to Windows shortcut files. An attacker could deliver a .desktop file that, if the user runs it, executes code.
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 3 months
- Disclosed after 2 months
Created attachment 9312210
desktopDangerousExtension-Linux.html
Hi Team before starting this have a Look into the below issue description. in which it shows the shortcuts files are restricted and Changed to .download But the same for Linux are not prevented
https://bugs.chromium.org/p/chromium/issues/detail?id=1307930
https://bugs.chromium.org/p/chromium/issues/detail?id=1140417
.desktop is a Shortcut file in linux similar to .lnk in Windows which could have ability to invoke the executables
Tested in Latest Version of FireFox in Linux 5.7.0-kali1-amd64 (KERNEL)
REPRODUCTION CASE
1. Open the below attached html File in Firefox on linux
2. You can see the shortcut file is allowed and downloaded in linux without renaming
Impact: Lead to Executing Code
I have added a POC HTML The resultant download file will invoke Calc when it is trying to execute
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the download protection that renames dangerous shortcut extensions was not extended to the .desktop extension on Linux.
Impact
If the user executes the downloaded .desktop file, it could lead to code execution.
What the attacker needed
Firefox on Linux; victim downloads and runs the file
How it was found
- Open the provided HTML file in Firefox on Linux.
- Observe that the shortcut file is downloaded without being renamed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A .desktop file on Linux is like a shortcut that can run a program when opened. Firefox already renames similar Windows shortcut files to .download to stop accidental execution, but it does not do this for Linux .desktop files. If a user downloads and runs such a file, it could run harmful code.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.