.URL Extension Download Via Drag and Drop
Firefox blocked downloading .url files through normal download and extension APIs, but a drag-and-drop interaction could still create a .url file containing a UNC path or local file reference. An attacker could use this to leak NTLM hashes, expose environment variables, or read local files when the victim later opens the file.
Originally disclosed on Mozilla
- Fixed in 22 days
- Paid in 29 days
- Disclosed after 22 days
Created attachment 9328817
second.html
Hi team, Downloading .url file is restricted in Firefox on multiple phase Actual Download + Extension API's etc.
Because It has the impact of NTML Hash Leak, System Environment Variable Leak, Local File Read (Similar to symlink)
Have found a way to download the .url file via Drag and Drop.
Steps to reproduce:
1. Open the attached POC HTML File
2. Drag and Drop the safe <a> attribute to any location (You can find now the .url is downloaded)
3. Now for POC again upload it in the HTML file via browse,
4. BOOM you can find system.ini file from your local machine
Prevent .url creation (or) Creating .url file from drag and drop should be in proper http regex format to avoid including UNC path / File location instead of URL.(Since the user isn't aware of the background of drag and drop)
Sorry for my poor HTML without CSS :(
Tested in latest version of Firefox (112) on Windows 10 (Latest Patch)
Refer: CVE-2023-25734 for impact
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 drag-and-drop download path did not apply the same .url file restrictions as the normal download and extension APIs, and it did not validate that the target was a proper HTTP URL rather than a UNC path or local file location.
Impact
An attacker could cause a .url file to be saved that points to a UNC path or local file, potentially leaking NTLM hashes, environment variables, or local file contents when the victim interacts with it.
What the attacker needed
Victim uses Firefox on Windows; victim drags and drops a link; victim opens the downloaded .url file
How it was found
- Open the attached proof-of-concept HTML file.
- Drag and drop the safe anchor attribute to any location, which downloads a .url file.
- Upload the downloaded .url file back into the HTML file via browse.
- Observe that a local system file can be read.
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 .url file is a shortcut that Windows uses to open a web address or a file. Firefox tried to stop websites from saving these shortcuts because a malicious one can point to a file on the victim's computer or to a network share that leaks login information. This report shows that dragging a link out of the browser could still save such a shortcut, bypassing the block.
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.