Skip to content
XSS Disclosed report Intermediate

Reflected Flash XSS using swfupload.swf with an epileptic reloading to bypass the button-event

The swfupload.swf file hosted on the main domain accepted parameters that let an attacker inject HTML, including a javascript link, into the Flash button. By rapidly reloading the SWF, an attacker could catch the click event before the Flash button took it over, triggering reflected cross-site scripting on the imgur.com domain.

Frans Rosén Follow

Originally disclosed on HackerOne

  • Triaged in 6 days
  • Fixed in 42 days
  • Paid in 47 days
  • Disclosed after 10 months

Hi, This was a fun one.

So I noticed you're using swfupload.swf which is hosted on the main domain, imgur.com. This swfupload.swf as some settings you can use to modify the button on the upload. You can actually insert HTML into the Flash, but the button event (that you select yourself using another parameter) is taking over the MouseClick-event from the HTML-content you provide.

However, if you're really quick, you can actually catch the even in the HTML anyway. So by making a page that would reload the SWF constantly (from cache that is) you can make a page that looks like this:

<iframe src="about:blank" id="x"></iframe>

<script>u='https://imgur.com/include/flash/swfupload.swf?buttonDisabled=&buttonText=%3Ca%20%20href=%22javascript:alert(document.domain)%22%3ECLICKME<br />CLICKME<br />CLICKME<br />CLICKME<br />CLICKME<br />CLICKME<br />CLICKME<br />CLICKME%3C/a%3E&buttonImageURL=/&buttonTextStyle=a{color:%23ff00ff}&buttonAction=-120&buttonCursor=-2';
setInterval(function(){document.getElementById('x').contentWindow.location=u},300)</script>

That will reload the content over and over, and if you click the text in the right time, the XSS will trigger.

I think I got an epileptic reaction out of testing this, but it was fun anyway, haha. You should probably move the swfupload.swf to another domain, and just embed it on imgur.com since that will give you the same options as today, but without the possibility to access the SWF directly and inject the parameters on your domain.

PoC-image attached.

Cheers, Frans

Attachments

Screen_Shot_2015-10-01_at_04.06.05.png
Screen_Shot_2015-10-01_at_04.06.05.png From the original on HackerOne

The original report as published on HackerOne, by fransrosen. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 SWF reflected user-controlled parameters into HTML content without sanitising them, and the click-handling race could be won by reloading the file repeatedly.

What the attacker needed

Victim clicks injected text; timing race won via reloads

The fix

The SWF should be moved to a separate domain and embedded on imgur.com so it cannot be accessed directly with injected parameters.

How it was found

  1. Load the swfupload.swf with parameters that inject an HTML link into the button text.
  2. Place the SWF in an iframe and reload it repeatedly on a short interval.
  3. Click the injected text at the right moment to trigger the script.

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 Flash file on the site let you put your own HTML into the upload button. Normally the Flash button grabbed the click first, but by reloading the file very fast the attacker could click the injected link before that happened. That let a script run as if it came from the site itself.

What is XSS?

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

More by Frans Rosén

View all

26 more disclosed reports, best first.

More from Imgur

View all

The newest disclosed reports for this program.

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.