Query parameter reordering causes redirect page to render unsafe URL
A reflected XSS vulnerability existed on the redirect page because duplicate 'url' parameters were reordered by Cloudflare, causing the application to use a different parameter than the browser. An attacker could execute JavaScript in Internet Explorer, but CSP blocked it in Chrome.
- Triaged in 8 hours
- Fixed in 13 hours
- Paid in 8 hours
- Disclosed after 19 hours
Summary by the program
@kenziy found a reflected Cross-Site Scripting (XSS) vulnerability that was exploitable in Internet Explorer due to the CSP being ignored. The root cause of the vulnerability was rather interesting. In production, we had "Query String Sort" enabled in the Cloudflare caching settings. This is why we couldn't reproduce the same behavior in our local development environments. When Cloudflare sorted the url parameters, it placed the last url parameter (with the XSS payload) first because J (capital) comes before the h in the ASCII table. We noticed that the application load balancer (ALB) on AWS received the attributes in ascending order. The reason why this recently became a vulnerability, is because the app is now rendering the external link warning in React. Here's a step-by-step description what happened:
- user submits request with
url=http://test.comandurl=JAVASCRIPT:some-payload(in that order) - Cloudflare reorders the parameters to
url=JAVASCRIPT:some-payloadandurl=http://test.com - ALB and nginx dispatch the request to unicorn
- unicorn uses the last
urlin the parameter, which matches the passed signature in the URL - unicorn responds with a 200 OK and renders a container to load the React application
- React grabs the
urlfrom the query parameters, which, for the browser, is stillurl=JAVASCRIPT:some-payload, noturl=http://test.com - React parses the URL and renders the XSS payload
The vulnerability was addressed by disabling the setting in Cloudflare. We want to thank @kenziy for bringing this to our attention, this was a great find!
The report
Hello hackerone team
I want to report I bypass w/c lead to XSS (but limited only for IE) due to CSP block on chrome
Here is the POC
https://hackerone.com/redirect?signature=c9304cadaeabca0bfb7b92503c0318da5c42a86b&url=http%3A%2F%2Fbuglabs.me&url=JAVASCRIPT:alert%09(document.domain)
How I find this issue
First I notice that before you will redirect to other site hackerone will notify users that they are being redirected to other website Here is example
https://hackerone.com/redirect?signature=c9304cadaeabca0bfb7b92503c0318da5c42a86b&url=http%3A%2F%2Fbuglabs.me
But when you change the url it will not match to the signature (h1 alers) by you can bypass it by adding &url so it would look like this
https://hackerone.com/redirect?signature=c9304cadaeabca0bfb7b92503c0318da5c42a86b&url=http%3A%2F%2Fbuglabs.me&url=
Now I try doing this to trigger XSS
https://hackerone.com/redirect?signature=c9304cadaeabca0bfb7b92503c0318da5c42a86b&url=http%3A%2F%2Fbuglabs.me&url=JAVASCRIPT:alert%09(document.domain)
due to CSP protection I was not able to trigger XSS (My bypass skills on CSP is not good enought :-( ) But in IE it works :-)
I beleive that this is an issue
Minor RTLO that can treak users
And another things is I try to do a RTLO on the URL (But because it has filter alert I dont know if this will trigger your interest)
https://hackerone.com/redirect?signature=c9304cadaeabca0bfb7b92503c0318da5c42a86b&url=http%3A%2F%2Fbuglabs.me&url=http%3A%2F%2F%09%E2%80%AEmoc.enorekcah
Tested
IE11 - for XSS Chrome, Mozilla - for RTLO
Advance Merry Christmas guys :-)
Cheers Kenziy
Impact
Trick user or trigger malicious script
Attachments


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 used the last 'url' parameter for signature verification while the browser used the first, due to Cloudflare's query string sorting, and the React frontend rendered the unsanitised URL.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable site, but only in Internet Explorer; Chrome's CSP blocked the exploit.
What the attacker needed
Victim uses Internet Explorer; victim clicks a crafted link
The fix
The vulnerability was fixed by disabling the 'Query String Sort' setting in Cloudflare.
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 redirects you, it sometimes checks a signature to ensure the link is safe. Here, the attacker added two 'url' parameters; Cloudflare sorted them, so the server checked one but the browser used the other. This let the attacker run malicious JavaScript, but only in Internet Explorer because Chrome's security policy (CSP) blocked it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.