Skip to content
XSS Write-up Intermediate

XSS in Uber via Cookie

A JSONP endpoint on get.uber.com used the value of a cookie to choose which server to load a script from, and that cookie could be set for the whole uber.com domain by an XSS on another subdomain. An attacker could therefore run arbitrary JavaScript on get.uber.com.

zhchbin Follow

Published on zhchbin.github.io

Bounty$5,000 View original

This write up is about part of my latest XSS report to Uber@hackerone. Sorry for my poor English first of all, I will try my best to explain this XSS problem throughly.

zhchbin, on zhchbin.github.io

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 JSONP loader trusted a cookie value to set the script source without validating that it pointed to an allowed server.

Impact

An attacker could execute arbitrary JavaScript on get.uber.com, but this required first finding an XSS on another uber.com subdomain to set the cookie.

What the attacker needed

An XSS on any uber.com subdomain; victim visits the crafted page

How it was found

  1. Find a reflected XSS on a subdomain of uber.com that allows setting a cookie for the whole domain.
  2. Use that XSS to set the _rfiServer cookie to an attacker-controlled domain.
  3. Visit get.uber.com, which reads the cookie and makes a JSONP request to the attacker's domain, executing the returned script.

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.

A cookie is a small piece of data a website stores in your browser, and a site can allow its subdomains to share a cookie. Here, one page on a subdomain let an attacker run code, and that code could set a shared cookie that another page trusted to decide where to load a script from. This meant the attacker's script ran on the second page too.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Uber

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.