Skip to content
CSRF Disclosed report Intermediate

Flash Content-Type Sniffing Vulnerability

A Flash file uploaded with a .jpg extension could be loaded cross-origin and used to read the source of pages on the target site, including anti-CSRF tokens. The attacker could then submit a forged request to send a message as the victim.

prakharprasad Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 29 days
  • Disclosed after 30 days

Hello,

There's a Flash Content-Type Sniffing vulnerability. Using this vulnerability I can read the client side source code of your website from a different origin (say prakharprasad.com) and then look for potentially sensitive data in those pages for example - CSRF prevention tokens and then successfully mount a side-wide CSRF attack (as I can read the token every time and on every page) or read messages. Once the victim views my page, I can read his https://staging.uzbey.com/* webpage source and then extract out the data I need (messages, anti-csrf tokens and what not).

Proof-of-Concept:

  1. Login to your Uzbey account
  2. Visit https://demo.prakharprasad.com/uzbey/uzbey.html (and wait for 5 -10 seconds)
  3. Now visit https://staging.uzbey.com/messages and you'll see a message has been sent to admin saying DemoHAX :)

How this works?

  1. My webpage loads an <iframe> pointing to https://demo.prakharprasad.com/uzbey/sniff.html
  2. sniff.html essentially embeds an SWF-file that has been uploaded to my (attacker's) photo gallery with .jpg extension - https://staging.uzbey.com/sites/default/files/magic.jpg
  3. Once the embedded file run, it sends a GET request to https://staging.uzbey.com/messages/newand passes the callback to a function called nice()within sniff.html. The callback data is the source code of the page that was requested with a GET earlier.
  4. Nownice()function parses the page for form_bulid_idand form_token and then builds up a form to mount the CSRF attack and then submits the form with a POST request.
  5. Game over ! :)

Basically I used the upload functionality to upload the malicious SWF with .jpg extension and then loaded it in an iframe and did my work!

Thanks,

@prakharprasad

The original report as published on HackerOne, by prakharprasad. 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 upload feature only checked the file extension and did not validate the actual file type, allowing a Flash file to be stored and served as an image.

Impact

An attacker could read the victim's page source, extract anti-CSRF tokens, and send messages as the victim.

What the attacker needed

Victim logged in; victim visits attacker page; attacker can upload a file

How it was found

  1. Log in to the Uzbey account.
  2. Visit the attacker's demo page and wait a few seconds.
  3. Visit the messages page and observe that a message has been sent to admin.

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.

Flash is a browser plugin that can make network requests. The site let people upload a Flash file but only checked the file extension, so it was treated as an image. Because the file was served from the site, it could read pages on that site and steal a secret token used to protect forms.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by prakharprasad

View all

17 more disclosed reports, best first.

More from Uzbey

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.