Skip to content
XSS Write-up Intermediate

DOM XSS in Facebook Mobile Site/App Login

The Facebook mobile login page reflected a user-controlled cancel_url parameter into the page without proper sanitisation, allowing DOM-based cross-site scripting. An attacker could craft a link that executes script in the context of the Facebook login page when the victim opens it.

Johns Simon Follow

Published on thesecurityexperts.wordpress.com

I was wondering if it was vulnerable to xss.So i checked by inputting javascript pseudo protocol ‘javascript:prompt(1)’ and clicked the ‘not now’,And i was shocked to see prompt 🤤..cool..Now what could an xss on a login page could do?.🤔

johns simon, on thesecurityexperts.wordpress.com

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 cancel_url parameter was written into the DOM without sanitisation, enabling DOM-based XSS.

Impact

An attacker could run script in the context of the Facebook login page, which may allow actions on behalf of the victim, though the text does not demonstrate a full account takeover.

What the attacker needed

Victim clicks a crafted link; Facebook mobile login flow

How it was found

  1. Open the Facebook sign-in flow from a site that offers 'Sign in with Facebook'.
  2. Observe the cancel_url parameter in the login page URL.
  3. Supply a crafted cancel_url value and load the page to trigger script execution.

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 you click 'Sign in with Facebook', the site passes along a web address to return to if you cancel. The report says that address was placed into the page without being made safe, so a malicious address containing code could run in the browser. That lets an attacker run their own script as if it came from Facebook's login page.

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 Johns Simon

View all

2 more disclosed reports, best first.

More from Meta

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.