Reflected XSS on Partners Subdomain
A reflected cross-site scripting vulnerability existed on the partners subdomain, allowing an attacker to inject malicious content that would execute when the site loaded. The attacker could run script in a victim's browser in the context of the site.
- Triaged in 4 days
- Fixed in 24 days
- Paid in 4 days
- Disclosed after 44 days
Summary by the program
There was a reflected cross site scripting vulnerability at https://partners.uber.com/. By providing a specifically crafted value, it was possible for an attacker to inject malicious content into the partners.uber.com site, which would then be executed when the site is loaded.
We enjoyed working with @mefkan on this issue and look forward to their next submission to our program.
Summary by the researcher
I will publish my blog in a few days :) Check out my twitter ! https://twitter.com/mefkansec
And here it is...
https://medium.com/@efkan162/how-i-xssed-uber-and-bypassed-csp-9ae52404f4c5
What the report shows
The target is the Uber partners site at https://partners.uber.com/. The program's summary states that a reflected cross site scripting vulnerability existed there: by supplying a specifically crafted value, an attacker could inject malicious content into the site, and that content would then be executed when the site was loaded.
The report itself is very short. It does not include the vulnerable endpoint, the parameter name, the payload, the HTTP request or response, or any reproduction steps. What it does give is the outcome: the issue was rated high severity, a bounty of 2,000 USD was paid, and the report was disclosed on 16 September 2018.
So the confirmed facts are limited to the class of bug (reflected XSS), the host (partners.uber.com), the mechanism at a high level (a crafted value reflected into the page and executed on load), and the reward. Anything more specific about how the value reached the response would be guesswork.
Root cause
The program's summary says a specifically crafted value could inject malicious content into partners.uber.com, which would then be executed when the site was loaded. The report does not identify which parameter or which part of the page was affected. That is the likely root cause implied by the summary: the application takes a value from the request and writes it into the response in a context where the browser treats it as code rather than text.
Impact
As described, an attacker could inject malicious content into the partners site that would execute when the site was loaded. In practice, reflected XSS lets an attacker run script in the security context of the affected origin, in a victim's browser, when the victim follows a crafted link. That script can act with the victim's privileges on that site: reading page content, making requests as the user, or manipulating what the user sees. The program classified the issue as high severity. The report does not describe any specific data that was accessed or any account that was compromised.
How this kind of bug works
Reflected XSS arises when an application copies a value from the request (a query string parameter, a path segment, a form field, a header that ends up in the page) into the response body without context-appropriate output encoding. The browser receives the response and parses it as HTML. If the injected value contains characters that the parser interprets as markup, such as <, >, quotes or an event handler attribute, the browser builds DOM nodes and executes script that the application never intended to run.
The context matters. A value placed between HTML tags needs different escaping from one placed inside an attribute, inside a JavaScript string, inside a URL in an href, or inside a CSS block. Encoding that is correct for one context can be useless in another. The other half of the defence is the Content Security Policy: a strict policy that disallows inline script and restricts script sources can stop injected script from executing even when the reflection exists. The report's own framing is that the crafted value was executed when the site loaded, which is the classic reflected pattern: the payload lives in the URL and runs on page load.
How to test for it
- Map every place where input from the request appears in the response. Query parameters, path segments, fragment-driven client-side rendering, error messages, search boxes, redirect targets and headers echoed into the page are all candidates.
- Send a benign marker value that is unlikely to appear naturally, and search the response body for it. Note the exact context: between tags, inside an attribute, inside a script block, inside a URL.
- Based on the context, send a probe that would be inert if properly encoded but would break out if not. For an HTML text context, a tag with an event handler; for an attribute, a quote to close the attribute followed by an event handler; for a script string, a quote and a statement terminator. Keep probes minimal and non-destructive.
- Confirm execution in a real browser rather than relying on string matching. A positive result is your marker appearing in the DOM as an element or as executable script, and the browser running your handler. Check whether a CSP blocks execution; if it does, the reflection may still be a finding, but the impact depends on whether the policy can be bypassed.
- Common false positives: the value is reflected but HTML-encoded (
<,"), so it renders as text; the reflection lands in a context where the browser does not execute it, such as inside a comment or a non-scriptable attribute; the input is reflected only after server-side sanitisation that strips the dangerous characters; or the page is served with a policy that reliably blocks the payload. Also watch for reflections that only appear in the raw response but are overwritten by client-side rendering before the user sees them.
How it is fixed
The standard fix is context-aware output encoding at the point where data is written into the response: HTML-entity encoding for text and attribute contexts, JavaScript-safe encoding for script contexts, URL encoding for URL contexts, and CSS-safe encoding for style contexts. Input validation and allow-lists help where the expected format is narrow, but encoding is the primary control. A strict Content Security Policy provides defence in depth by preventing inline and unauthorised script from running. Frameworks with auto-escaping templates reduce the risk, provided developers do not bypass the escaping with raw-output helpers. Setting the HttpOnly flag on session cookies limits what injected script can steal, though it does not stop the script from acting as the user.
Hunting notes
Reflected XSS tends to hide in places where input is echoed back for convenience: search results pages, error and validation messages, login and password-reset flows that reflect an identifier, redirect and return-URL parameters, and any page that reads a value from the query string to prefill a form or a heading. Partner and business portals are good hunting grounds because they often have many small, older features bolted onto a main application.
Recon signals worth following: parameters whose values appear verbatim in the HTML, endpoints that return the same page with different query strings, and applications with a permissive or absent CSP. Comparing the encoded and raw forms of a reflected value quickly tells you whether the output is being escaped.
To get a report accepted, show execution, not just reflection: a browser screenshot or recording of the handler firing, the exact request and payload, and a clear statement of what the script can do in the victim's session on that origin. If a CSP is present, demonstrate whether it can be bypassed, because a blocked payload is a much weaker finding. Keep the proof minimal and avoid touching other users' data.
What happened, in plain words
Uber runs a website for its partner drivers at https://partners.uber.com/. According to the program's own summary, that site had a reflected cross site scripting vulnerability. In plain terms: the site took a value from the address the visitor arrived with and wrote it into the page without making it safe, so a specially crafted value could put malicious content into the page, and that content would run in the visitor's browser when the page loaded.
A website is a set of pages your browser downloads and displays. Some pages are built fresh for each visit, using values that arrive with the request, such as the part of the address after a question mark. If the site copies such a value into the page as-is, the browser cannot tell the difference between text the site meant to show and text an attacker supplied. That is the heart of this bug class.
This particular report is short. It does not name the page, the parameter, the payload, the request or the response, and it gives no steps to reproduce. What it does record is the outcome: the issue was rated high severity, a bounty of 2,000 USD was paid, and the report was disclosed on 16 September 2018.
So the confirmed facts are the type of bug (reflected XSS), the host (partners.uber.com), the mechanism at a high level (a crafted value reflected into the page and executed on load), and the reward. Anything more specific about how the value reached the response would be guesswork.
Root cause
The program's summary says a specifically crafted value could inject malicious content into partners.uber.com, which would then be executed when the site was loaded. The report does not identify which parameter or which part of the page was affected. That is the likely root cause implied by the summary: the application takes a value from the request and writes it into the response in a place where the browser treats it as code rather than text.
A useful comparison is a noticeboard where visitors can pin a note that a clerk copies onto the board. If the clerk copies whatever is written, including instructions like "tear down the board", the board obeys them. Encoding is the clerk's rule of writing everything down as plain text, so instructions stay words on paper.
Impact
As described, an attacker could inject malicious content into the partners site that would execute when the site was loaded. In practice, reflected XSS lets an attacker run script in the security context of the affected origin, in a victim's browser, when the victim follows a crafted link. That script can act with the victim's privileges on that site: reading page content, making requests as the user, or manipulating what the user sees. The program classified the issue as high severity. The report does not describe any specific data that was accessed or any account that was compromised.
How this kind of bug works
In general, reflected XSS arises when an application copies a value from the request (a query string parameter, a path segment, a form field, a header that ends up in the page) into the response body without context-appropriate output encoding. The browser receives the response and parses it as HTML. If the injected value contains characters that the parser interprets as markup, such as <, >, quotes or an event handler attribute, the browser builds page elements and executes script that the application never intended to run.
The context matters. A value placed between HTML tags needs different escaping from one placed inside an attribute, inside a JavaScript string, inside a URL in an href, or inside a CSS block. Encoding that is correct for one context can be useless in another. The other half of the defence is the Content Security Policy: a strict policy that disallows inline script and restricts script sources can stop injected script from executing even when the reflection exists. The report's own framing is that the crafted value was executed when the site loaded, which is the classic reflected pattern: the payload lives in the URL and runs on page load.
How to test for it
- Map every place where input from the request appears in the response. Query parameters, path segments, fragment-driven client-side rendering, error messages, search boxes, redirect targets and headers echoed into the page are all candidates.
- Send a harmless marker value that is unlikely to appear naturally, and search the response body for it. Note the exact context: between tags, inside an attribute, inside a script block, inside a URL.
- Based on the context, send a probe that would be inert if properly encoded but would break out if not. For an HTML text context, a tag with an event handler; for an attribute, a quote to close the attribute followed by an event handler; for a script string, a quote and a statement terminator. Keep probes minimal and non-destructive.
- Confirm execution in a real browser rather than relying on string matching. A positive result is your marker appearing in the page as an element or as executable script, and the browser running your handler. Check whether a Content Security Policy blocks execution; if it does, the reflection may still be a finding, but the impact depends on whether the policy can be bypassed.
- Common false positives: the value is reflected but HTML-encoded (
<,"), so it renders as text; the reflection lands in a context where the browser does not execute it, such as inside a comment or a non-scriptable attribute; the input is reflected only after server-side sanitisation that strips the dangerous characters; or the page is served with a policy that reliably blocks the payload. Also watch for reflections that only appear in the raw response but are overwritten by client-side rendering before the user sees them.
How it is fixed
In general, the standard fix is context-aware output encoding at the point where data is written into the response: HTML-entity encoding for text and attribute contexts, JavaScript-safe encoding for script contexts, URL encoding for URL contexts, and CSS-safe encoding for style contexts. Input validation and allow-lists help where the expected format is narrow, but encoding is the primary control. A strict Content Security Policy provides defence in depth by preventing inline and unauthorised script from running. Frameworks with auto-escaping templates reduce the risk, provided developers do not bypass the escaping with raw-output helpers. Setting the HttpOnly flag on session cookies limits what injected script can steal, though it does not stop the script from acting as the user.
Hunting notes
In general, reflected XSS tends to hide in places where input is echoed back for convenience: search results pages, error and validation messages, login and password-reset flows that reflect an identifier, redirect and return-URL parameters, and any page that reads a value from the query string to prefill a form or a heading. Partner and business portals are good hunting grounds because they often have many small, older features bolted onto a main application.
Recon signals worth following: parameters whose values appear verbatim in the HTML, endpoints that return the same page with different query strings, and applications with a permissive or absent Content Security Policy. Comparing the encoded and raw forms of a reflected value quickly tells you whether the output is being escaped.
To get a report accepted, show execution, not just reflection: a browser screenshot or recording of the handler firing, the exact request and payload, and a clear statement of what the script can do in the victim's session on that origin. If a Content Security Policy is present, demonstrate whether it can be bypassed, because a blocked payload is a much weaker finding. Keep the proof minimal and avoid touching other users' data.
Glossary
- Reflected XSS: a bug where a value from the request is written into the page and the browser runs it as code, usually when a victim opens a crafted link.
- Cross site scripting (XSS): a class of bugs where an attacker gets their own script to run inside a trusted website in someone else's browser.
- Payload: the crafted value an attacker sends, designed to be interpreted as code by the browser.
- Parameter: a named value in a request, often after a question mark in a URL, such as
?name=value. - Request: the message your browser sends to a server asking for a page or data.
- Response: the message the server sends back, usually containing the page's HTML.
- HTML: the language that describes the structure of a web page, using tags such as
<div>. - Encoding (output encoding): converting characters so the browser displays them as text instead of treating them as markup.
- Context: the place in the page where a value lands (text, attribute, script, URL, style), which determines what encoding is needed.
- Content Security Policy (CSP): a set of rules a site sends to the browser saying which scripts may run, used as a second line of defence.
- DOM: the browser's in-memory model of the page, built from the HTML it received.
- Origin: the combination of scheme, host and port that defines a site's security boundary, for example
https://partners.uber.com. - Session cookie: a small piece of data the browser stores and sends with requests so the site recognises a logged-in user.
- HttpOnly: a cookie flag that stops scripts in the page from reading that cookie.
- Sanitisation: cleaning input by removing or neutralising dangerous characters or markup.
- False positive: a test result that looks like a bug but is not exploitable in practice.
- Bounty: a reward paid by a company to a researcher who reports a valid security issue.