Skip to content
XSS Write-up Beginner

Reflected XSS in Facebook, Twitter & Google Training Platforms

The OAuth callback endpoint reflected the error_description parameter into the page without HTML encoding, allowing script execution. An attacker could craft a link that runs JavaScript in a victim's browser on the affected training platforms.

medium.com

Published on medium.com

During bug bounty research, most researchers focus on core application functionality. However, some vulnerabilities appear in unexpected places such as error handling mechanisms.

NullSecurityX, on medium.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

The application inserted the error_description parameter into the HTML error message without output encoding.

Impact

An attacker could run JavaScript in a victim's browser on the affected training platforms, though the text does not describe any specific harm beyond script execution and DOM manipulation.

What the attacker needed

Victim clicks a crafted link; target uses the fb_callback endpoint

The fix

The error_description value should be HTML-encoded before it is placed in the page; the text does not say whether this was fixed.

How it was found

  1. Start the Facebook OAuth login flow on the target platform.
  2. Deny or cancel the login so the app redirects to the fb_callback endpoint with error parameters.
  3. Put a test value in error_description and check the page source to confirm it is reflected unencoded.
  4. Replace the test value with an XSS payload in error_description and load the callback URL 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 log in with Facebook, the site sometimes sends you back with an error message in the web address. This site put that message straight into the page without cleaning it, so someone could put code in the link that runs in your browser. That kind of flaw is called reflected cross-site scripting.

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.