SSL-protected Reflected XSS in https://m.uber.com/0-dfffb25d2cf6ceeb0a27.js Endpoint
The _ga parameter on a mobile Uber endpoint was reflected unescaped inside a JavaScript string, allowing an attacker to inject script tags and execute arbitrary JavaScript. The endpoint's Content Security Policy also had a wildcard script-src and no base-uri, which could be abused to load attacker-controlled scripts.
Originally disclosed on HackerOne
- Disclosed after 4 days
Summary
The _ga request parameter at the https://m.uber.com/0-dfffb25d2cf6ceeb0a27.js mobile endpoint is copied into a javascript string encapsulated in double quotation marks, resulting in SSL-protected payloads being reflected unmodified in the application's response. The script-src whitelist at the endpoint includes a wildcard *.cloudfront.net host, which could be used by any attacker with an Amazon Web Services account to provision an arbitrary cloudfront.net host to serve trusted files from. The endpoint also has a missing base-uri, which allows the injection of base tags. They can be used to set the base URL for all relative (script) URLs to an attacker controlled domain. In addition to the reflected XSS issue, both the script-src and basi-uri issues are considered high severity findings under Content Security Policy 3.
Security Impact
Arbitrary SSL-protected XSS can be reflected unescaped from the https://m.uber.com/0-dfffb25d2cf6ceeb0a27.js mobile endpoint, resulting in the ability for an attacker to generate arbitrary javascript and/or html content.
Reproduction Steps
https://m.uber.com/0-dfffb25d2cf6ceeb0a27.js?_ga=asdf"}}</script><script>alert(1)</script>
Specifics
The following unescaped code is rendered:
{"enabled":true,"sid":"bbc661585c424072","url":"www.cdn-net.com","cf":1022963},"queryParams":{"_ga":"asdf\"}}</script><script>alert(1)</script>"},"useragent":{"ua":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36","browser":
Impact
With properly crafted javascript and/or html, an attacker could harvest Uber login and password credentials, credit card payment information etc.
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
Root cause
Likely the application failed to escape or encode the _ga parameter before embedding it into a JavaScript string in the response.
Impact
An attacker could execute arbitrary JavaScript in the context of the Uber mobile site, potentially harvesting login credentials and credit card information.
What the attacker needed
Victim clicks a crafted link
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 a website takes something you type (like a URL parameter) and puts it directly into the page without cleaning it, an attacker can sneak in their own code. Here, the _ga parameter was placed inside a JavaScript string, and by breaking out of that string an attacker could run their own script in the victim's browser. This is called reflected cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.