xss in https://www.uber.com
A cross-site scripting vulnerability existed on the Uber website via a URL parameter that allowed script execution. An attacker could craft a link that, when visited, would run arbitrary JavaScript in the victim's browser.
- Triaged in 23 hours
- Fixed in 18 days
- Paid in 27 days
- Disclosed after 39 days
Hey,
this vulnerability is essentially the same as bug 145276, i'm reporting it again just in case.
there's a cross site scripting vulnerability in https://www.uber.com/.
steps to reproduce:
1.visit https://www.uber.com/?kxsrc=https%3A//beacon.krxd.net/optout_check%3Fcallback%3Dalert%28/XSSED/.source%29 2. wait until the page finishes loading
3.see the xss alert.
wonder it would be eligible for a bounty?
Cheers, Mario
What the report shows
The target is the main marketing site, https://www.uber.com/. The researcher, reporting through HackerOne, states that the issue is essentially the same as an earlier report (bug 145276) and that it is being filed again just in case. The weakness class recorded for the report is generic cross-site scripting.
The whole finding rests on a single URL. The researcher gives three steps to reproduce it:
- Visit the URL below.
- Wait until the page finishes loading.
- See the XSS alert.
https://www.uber.com/?kxsrc=https%3A//beacon.krxd.net/optout_check%3Fcallback%3Dalert%28/XSSED/.source%29
Decoded, the kxsrc query parameter carries a URL pointing at beacon.krxd.net/optout_check with a callback parameter whose value is alert(/XSSED/.source). Inside the outer parameter, the inner URL's : and ? are percent-encoded, and the parentheses of the callback are encoded as %28 and %29. The researcher does not explain which script consumes kxsrc, how the value reaches the DOM, or why the callback ends up executing; the report contains only the URL and the observation that an alert box appears once the page has loaded.
The report does not state a severity, a CVSS score, a bounty amount, or a fix. It closes with a question about whether the issue would be eligible for a bounty, so no outcome is recorded in the text.
Root cause
The URL suggests a value in kxsrc reaches a third-party endpoint at beacon.krxd.net, but the report does not confirm how. The callback parameter of an opt-out check endpoint is a classic JSONP-style construct: the endpoint wraps its response in a function name supplied by the caller. If the page loads that endpoint as a script and the callback name is not restricted to a safe identifier, the caller controls part of the JavaScript that the browser executes in the origin of www.uber.com.
The report itself does not confirm this mechanism; it only demonstrates that the crafted URL produces script execution.
Impact
The demonstrated impact is an alert appearing after the crafted URL loads. In a real attack the same primitive would let an attacker run arbitrary JavaScript in a victim's browser session on that origin, which is the standard consequence of reflected cross-site scripting: reading page content, acting on the user's behalf against that origin, and phishing within a trusted page. Because the payload sits in a URL, exploitation would require a victim to follow a crafted link.
How this kind of bug works
Reflected cross-site scripting happens when input from a request is written into an HTML or JavaScript response without correct context-aware encoding, so the browser parses part of the input as code rather than data. The DOM-based variant happens when client-side JavaScript reads a value (from the query string, fragment, document.referrer, or a storage API) and writes it into a sink such as innerHTML, eval, document.write, or a script src, without sanitisation.
JSONP endpoints and third-party script loaders are a frequent source. A callback parameter is meant to be a function name, but if the server or the client accepts arbitrary characters, an attacker can supply an expression that executes on load. The same applies to parameters that carry a full URL to be loaded as a script: if the host is not pinned to an allowlist, the attacker chooses the code.
The defences are context-aware output encoding on the server, safe DOM APIs (textContent, setAttribute) on the client, a strict Content Security Policy that blocks inline and unauthorised script sources, validation of callback names against a strict identifier pattern, and allowlisting of any URL that is loaded as a script.
How to test for it
- Map every parameter that reaches client-side code: query string, fragment, path segments, and values read from storage or referrer. Browser developer tools with breakpoints on sinks, or a DOM-invariance tool, help here.
- For each parameter, send a benign marker first (a unique alphanumeric string) and confirm it appears in the DOM or in a script context. This distinguishes reflection from dead parameters.
- Escalate to context-appropriate probes: HTML metacharacters for markup contexts, quote and bracket characters for attribute and script-string contexts, and a function-call expression for callback-style parameters. Watch for execution, not just reflection.
- For URL-carrying parameters, try substituting a host you control and observe whether the page loads it as a script.
- A positive result is code executing in the target origin, demonstrated with a harmless alert or console message, plus a minimal URL that reproduces it.
Common false positives: the marker is reflected but HTML-encoded, so it renders as text; the payload fires only in the tester's own browser because of an extension; the reflection lands in a context where the browser does not execute it (for example inside a comment or a non-script attribute); or the value is sanitised by a client-side library that the tester had disabled. Always re-test in a clean browser profile and confirm the exact sink.
How it is fixed
Server-side, encode output for the context it lands in and never interpolate request data into a script block. For JSONP-style endpoints, validate the callback against a strict identifier pattern and reject anything else. For parameters that name a script URL, pin the host to an allowlist and reject other schemes. Client-side, avoid innerHTML and eval for untrusted values and use safe DOM APIs. Add a Content Security Policy with script-src restricted to known hosts and no unsafe-inline, which limits the damage of any missed sink.
Hunting notes
This class hides wherever third-party analytics, tag managers, A/B testing libraries, or JSONP endpoints are wired into a page. Parameters named callback, jsonp, src, url, redirect, next, and vendor-specific names are worth enumerating. Recon signals include pages that load scripts from marketing or analytics domains, query parameters that survive into the DOM, and older tag-manager integrations. To make a report land, show a minimal reproducing URL, state the exact sink and context, demonstrate execution with a harmless payload, and explain the realistic attack path (a link a victim must follow). Avoid claims about data theft unless you have demonstrated it.
One caveat worth carrying into any report: if the issue duplicates an earlier one, say so up front and reference it, as this researcher did.
What happened, in plain words
This report is about a security flaw on the main Uber website, https://www.uber.com/. The researcher, writing through the HackerOne bug bounty platform, says the problem is essentially the same as an earlier report (bug 145276) and is being filed again just in case. The weakness class recorded for the report is generic cross-site scripting.
To understand the flaw, you need one idea: a web page can be made to run JavaScript, the small programs that make pages interactive, and if an attacker can slip their own JavaScript into a trusted page, that code runs with the page's own authority. The researcher shows this is possible on the Uber site by getting the browser to pop up an alert box.
The whole finding rests on a single web address. The researcher gives three steps to reproduce it:
- Visit the URL below.
- Wait until the page finishes loading.
- See the XSS alert.
https://www.uber.com/?kxsrc=https%3A//beacon.krxd.net/optout_check%3Fcallback%3Dalert%28/XSSED/.source%29
Let us take that address apart, because every part matters.
https://www.uber.com/is the page being visited, the trusted site.?marks the start of the query string, the part of a URL that carries extra information to the page. Think of it as a note handed to the page along with the request.kxsrc=is the name of the parameter, the label on that note. The report does not say which script on the page reads it.- The value after
=is itself a URL, but written in encoded form.%3Ais the percent-encoded form of:, and%3Fis the encoded form of?. So the value decodes tohttps://beacon.krxd.net/optout_check?callback=alert(/XSSED/.source). beacon.krxd.netis a third-party host named in the value; the report does not say how the page uses it.callback=is a parameter of that third-party endpoint. The value given to it isalert(/XSSED/.source), with its parentheses encoded as%28and%29.
Why does this matter? A callback parameter on an endpoint like this is a classic JSONP-style construct. JSONP is an old technique for fetching data across sites: the server wraps its answer in a function name that the caller supplies, so the browser can run the answer as a script. If the caller can put anything into that function name, the caller controls part of the JavaScript that runs. Here the supplied value is a call to alert, the browser's built-in pop-up function, which is a harmless way to prove that code executed.
The report contains only the URL and the observation that an alert box appears once the page has loaded.
In general, how this kind of bug works
This is cross-site scripting, usually shortened to XSS. The name describes the mechanism: input that arrives in a request is written back into the page without being properly encoded, so the browser treats part of it as code rather than as harmless text. A useful comparison is a form where you write your name and it is printed on a badge. If the printer treats anything you write as instructions rather than letters, someone writing "print this badge twice" gets two badges. In a web page, the "instructions" are JavaScript, and the browser obeys them because they appear to come from the trusted site.
A closely related variant is DOM-based XSS. Here the server is not necessarily at fault: JavaScript already running in the page reads a value from the query string, the fragment (the part after #), the referring page, or browser storage, and writes it into a dangerous place, called a sink. Common sinks include innerHTML, eval, document.write, and the src of a script tag. If the value is not cleaned first, it becomes code.
JSONP endpoints and third-party script loaders are frequent sources. A callback parameter is meant to be a function name, but if the server or the client accepts arbitrary characters, an attacker can supply an expression that executes on load. The same applies to parameters that carry a full URL to be loaded as a script: if the host is not pinned to an allowlist, the attacker chooses the code.
The demonstrated impact is an alert appearing after the crafted URL loads. In a real attack the same primitive would let an attacker run arbitrary JavaScript in a victim's browser session on that site: reading page content, acting on the user's behalf against that site, and phishing within a trusted page. Because the payload sits in a URL, exploitation would require a victim to follow a crafted link.
The defences are well known. On the server, encode output for the context it lands in and never interpolate request data into a script block. For JSONP-style endpoints, validate the callback against a strict identifier pattern and reject anything else. For parameters that name a script URL, pin the host to an allowlist and reject other schemes. On the client, avoid innerHTML and eval for untrusted values and use safe DOM APIs such as textContent and setAttribute. Add a Content Security Policy, a browser rule that says which scripts may run, with script-src restricted to known hosts and no unsafe-inline, which limits the damage of any missed sink.
If you want to test for this yourself, the approach is methodical:
- Map every parameter that reaches client-side code: query string, fragment, path segments, and values read from storage or referrer. Browser developer tools with breakpoints on sinks, or a DOM-invariance tool, help here.
- For each parameter, send a benign marker first (a unique alphanumeric string) and confirm it appears in the page or in a script context. This distinguishes a live parameter from a dead one.
- Escalate to context-appropriate probes: HTML metacharacters for markup contexts, quote and bracket characters for attribute and script-string contexts, and a function-call expression for callback-style parameters. Watch for execution, not just reflection.
- For URL-carrying parameters, try substituting a host you control and observe whether the page loads it as a script.
- A positive result is code executing in the target site, demonstrated with a harmless alert or console message, plus a minimal URL that reproduces it.
Watch out for false positives: the marker is reflected but HTML-encoded, so it renders as text; the payload fires only in your own browser because of an extension; the reflection lands where the browser does not execute it, for example inside a comment or a non-script attribute; or the value is sanitised by a client-side library you had disabled. Always re-test in a clean browser profile and confirm the exact sink.
This class of bug hides wherever third-party analytics, tag managers, A/B testing libraries, or JSONP endpoints are wired into a page. Parameters named callback, jsonp, src, url, redirect, next, and vendor-specific names are worth enumerating. Signals to look for include pages that load scripts from marketing or analytics domains, query parameters that survive into the page, and older tag-manager integrations. To make a report land, show a minimal reproducing URL, state the exact sink and context, demonstrate execution with a harmless payload, and explain the realistic attack path (a link a victim must follow). Avoid claims about data theft unless you have demonstrated it. And if the issue duplicates an earlier one, say so up front and reference it, as this researcher did.
Glossary
- Cross-site scripting (XSS): a flaw where input from a request is treated by the browser as code instead of text, letting an attacker run JavaScript in a trusted page.
- Reflected XSS: the malicious input is echoed back in the response to the same request, usually via a crafted link.
- DOM-based XSS: JavaScript already in the page reads an untrusted value and writes it into a dangerous place, without the server being involved.
- Query string: the part of a URL after
?, carrying named values (parameters) to the page. - Parameter: a named value in a URL, such as
kxsrchere. - Percent-encoding: a way of writing special characters in a URL, for example
%3Afor:and%28for(. - JSONP: a technique for fetching data across sites by wrapping the response in a function name supplied by the caller, so the browser can run it as a script.
- Callback: the function name a caller gives to a JSONP endpoint, which the endpoint uses to wrap its answer.
- Sink: a place in code where a value is written and can become executable, such as
innerHTML,eval,document.write, or a scriptsrc. alert: the browser's built-in pop-up function, often used to prove that JavaScript executed.- Origin: the combination of scheme, host and port that defines a site's security boundary; code running in one origin can act on that origin's data.
- Content Security Policy (CSP): a browser rule set by the site that restricts which scripts may run and from where.
- Allowlist: an explicit list of permitted values, such as hosts allowed to serve scripts.
- CVSS: a standard scoring system for rating the severity of a vulnerability.
- Bug bounty: a programme that pays researchers for reporting security flaws responsibly.
- Duplicate: a report describing the same issue as an earlier one.