Skip to content
XSS Write-up Intermediate

Flickr XSS (Stored / DOM XSS)

The mobile Flickr site took user-controlled photo metadata and inserted it into the page without proper encoding, so a crafted title could run script in the mobile site's context. Because the API endpoint could be pointed at the mobile domain, an attacker could make a victim load a URL that executed the stored script, potentially leading to account takeover or exposure of private data.

Matt Austin Follow

Published on maustin.net

The mobile version of the flicker site accept input from the user controlled data and includes it in the HTML output without proper encoding. This is similar to the bug posted at: Abusing CORS for an XSS on Flickr which is actaully really similar to a bug I found on facebook mobile a few years ago: Facebook XSS via…

Matt Austin (@mattaustin), on maustin.net

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

Root cause

Likely the mobile site rendered user-supplied photo metadata into the page without HTML-encoding it, and its client-side routing accepted a same-domain API path that returned that unescaped data.

Impact

The stored script could run in the mobile site's origin and, as the reporter states, could lead to account takeover or access to private data.

What the attacker needed

Ability to upload a photo with metadata; victim opens a crafted mobile URL

The fix

The report does not describe the fix, but the output should have been HTML-encoded and the client-side routing should not have accepted API paths as relative routes.

How it was found

  1. Upload an image whose title metadata contains script-like content.
  2. Request the photo info through the API on the mobile domain.
  3. Note that the API response is served as script and on a different domain, which normally blocks exploitation.
  4. Change the API host to the mobile domain so the mobile site's relative-path check passes.
  5. Open the crafted mobile URL so the unescaped title is rendered and the script runs.

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.

When a website shows text you typed (like a photo title) it must convert special characters so the browser treats them as plain text, not as code. Here the mobile site did not do that, so a title containing code would run as a script in the browser of anyone who viewed it. That kind of injected script is called cross-site scripting (XSS), and it can let an attacker act as the logged-in user.

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 Matt Austin

View all

5 more disclosed reports, best first.

More from Flickr

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.