Skip to content
XSS Write-up Intermediate

Drag and Drop XSS in Firefox by HTML5 (Cross Domain in frames)

Firefox's protection against running JavaScript dragged into a page could be bypassed by changing the capitalisation of the scheme or by prefixing it with the feed: protocol. Combined with an HTML5 drop target inside a frame, this let an attacker run script in the context of the embedding site.

soroush.me

Published on soroush.me

First of all, this vulnerability and the related techniques have already been reported to Mozilla on 21st Nov 2011, without having any specific result till the date of this report (issue ID 704354 – works on all the latest versions which support HTML5). I had raised this bug as a major issue, but it seems it was not…

The author, on soroush.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could run script in the context of a site that embeds an attacker-controlled frame, but only if the victim performs a drag-and-drop, and NoScript from version 2.2.3 blocks it.

What the attacker needed

Firefox with HTML5 support; victim drags and drops the crafted text; target site embeds an external frame

The fix

NoScript 2.2.3 was released to protect users, while the underlying Firefox behaviour was reported to Mozilla and remained unfixed at the time of writing.

How it was found

  1. Type a javascript: URL in the address bar without pressing Enter and select it.
  2. Drag and drop the selection onto a page and note that no script runs.
  3. Change the capitalisation of the scheme and drag it again to see the script execute.
  4. Use a feed: prefixed URL to bypass the check in the same way.
  5. Drop the URL onto an HTML5 drop target that sits inside a frame so the script runs in the parent site's context.

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 write-up has not been written yet. The Original tab links to the source.

Browsers try to stop people from dragging text like a javascript: link into a page, because that text would run code. The researcher found that Firefox only checked the exact lowercase spelling, so a mixed-case version or a feed: prefix slipped through. If the drop area sat inside a frame on another site, the code ran as that site.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.