Skip to content
File upload Disclosed report Intermediate

.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.

Ameen Basha M K Follow

Originally disclosed on Mozilla

  • Fixed in 22 days
  • Paid in 29 days
  • Disclosed after 22 days
Text
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

The original report as published on Mozilla's Bugzilla, by Ameen Basha M K. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

  1. Open the attached proof-of-concept HTML file.
  2. Drag and drop the safe anchor attribute to any location, which downloads a .url file.
  3. Upload the downloaded .url file back into the HTML file via browse.
  4. 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.

More by Ameen Basha M K

View all

23 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.