Skip to content
XSS Disclosed report Intermediate

XSS on OAuth authorize/authenticate endpoint

The OAuth authorize/authenticate endpoint did not sanitise the oauth_callback parameter, allowing an attacker to inject HTML and script into the redirection page. An attacker could execute arbitrary JavaScript in the victim's browser after they authorised an application.

File Descriptor Follow

Originally disclosed on HackerOne

  • Triaged in 7 days
  • Fixed in 12 days
  • Paid in 9 days
  • Disclosed after 3 months

Summary by the researcher

Write-up: https://blog.innerht.ml/csp-2015/

The report

Hi, I would like to report an issue where certain endpoints on twitter.com and api.twitter.com is vulnerable to XSS.

##Detail The redirection page after authorization/authentication does not sanitize the oauth_callback parameter.

##PoC

  1. Go to http://innerht.ml/pocs/twitter-oauth-xss (Please use IE or something that hasn't implemented CSP)
  2. Click on Authorize app
  3. Alert pops up

Note: it also affects api.twitter.com as they both have the same endpoints

##Repo step

  1. Obtain the request token (https://api.twitter.com/oauth/request_token) where parameter oauth_callback contains HTML like javascript%3A%2F%2F"><script>alert(document.domain)</script>
  2. Redirect the victim to the authorize/authenticate page with the token

The original report as published on HackerOne, by filedescriptor. 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

Impact

An attacker could run script in the victim's browser on twitter.com or api.twitter.com after the victim authorised the app, but the proof of concept only worked in browsers without CSP, such as Internet Explorer.

What the attacker needed

Victim uses a browser without CSP; victim clicks Authorize app

How it was found

  1. Obtain a request token with an oauth_callback parameter containing HTML/JavaScript.
  2. Redirect the victim to the authorize/authenticate page with that token.
  3. The victim clicks Authorize app.
  4. An alert pops up, showing 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 report has not been written yet. The Original tab links to the source.

When you log in to a website using another service (like Twitter), the service asks you to approve the app and then sends you back to the app's website. The address to return to is given in a parameter called oauth_callback. The site failed to clean this parameter, so an attacker could put code in it that runs in your browser when you are sent back.

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 File Descriptor

View all

20 more disclosed reports, best first.

More from X / xAI

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.