Reflected XSS on /zuora_callback/payment_method endpoint
The errorMessage parameter on the zuora_callback/payment_method endpoint was not properly sanitised, allowing reflected cross-site scripting. An attacker could execute arbitrary JavaScript in a victim's browser on customers.gitlab.com, potentially leading to account takeover by changing the victim's email address.
GitLab
Originally disclosed on GitLab
- Fixed in 5 days
- Disclosed after 5 days
HackerOne report #1290342 by yashrs on 2021-08-04, assigned to @rshambhuni:
Report | Attachments | How To Reproduce
Report
Hi,
Summary
The parameter errorMessage is not sanitized properly on the endpoint https://customers.gitlab.com/zuora_callback/payment_method endpoint.
The only challenge we have as an attacker is that there is a signature as well on this endpoint which gets invalidated in some time, so the attacker can write some script to reproduce this as well. The root cause of the issue can be seen in this screenshot. The signature works across accounts as well so it's not an issue to exploit the XSS.


Steps to reproduce
Easy PoC:
- Go to http://testbug.infinityfreeapp.com/ehgl/poc.php and see if my script works. You should get a pop up if the script has worked successfully.
Normal PoC:
- Login to customers.gitlab.com
- Go to https://customers.gitlab.com/subscriptions/new?plan_id=2c92a0086a07f4a8016a2c0a1f7b4b4c&transaction=ci_minutes
- Enter 1 quantity, and any test credit card details, and random expiry, and CVV, and cardholder name.
- Click on
Buy CI minutes. - Observe that an HTTP request is made to
https://www.zuora.com/apps/PublicHostedPageLite.doand then tohttps://customers.gitlab.com/zuora_callback/payment_method?. Send the second request to the Repeater tab. ModifyerrorMessageparameter to contain"-alert(document.domain)-", and then right-click and copy URL. Open in browser. You can also open the same link in another GitLab account.

Impact
Cross-site scripting on customers.gitlab.com. Actions can be taken on behalf of the victim. Account takeover is possible because changing the email ID doesn't require the current password! So the attacker can write an XSS payload that changes the victim's email id in their account.

Examples
N/A
What is the current bug behavior?
N/A
What is the expected correct behavior?
Sanitization of strings
Relevant logs and/or screenshots
N/A
Output of checks
N/A
Results of GitLab environment info
N/A
Video PoC:
Regards,
Yash
Impact
As described above, an account takeover is possible in this scenario.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
- Screenshot_2021-08-04_at_9.38.30_PM.png
- Screenshot_2021-08-04_at_9.41.19_PM.png
- Screenshot_2021-08-04_at_9.47.48_PM.png
- Screen_Recording_2021-08-04_at_9.50.10_PM.mov
How To Reproduce
Please add reproducibility information to this section:
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 reflected the errorMessage parameter into the HTML response without proper output encoding or sanitisation.
Impact
An attacker could execute JavaScript in a victim's browser on customers.gitlab.com, and because changing the email address did not require the current password, account takeover was possible.
What the attacker needed
Victim opens a crafted link; attacker obtains a signature, which expires and must be…
The fix
The application should sanitise or properly encode the errorMessage parameter before reflecting it in the response.
How it was found
- Log in to customers.gitlab.com.
- Go to the subscriptions/new page with a specific plan and transaction parameter.
- Enter quantity, test credit card details, expiry, CVV, and cardholder name.
- Click on Buy CI minutes.
- Observe the HTTP request to zuora.com and then to customers.gitlab.com/zuora_callback/payment_method.
- Send the second request to Repeater, modify the errorMessage parameter to contain a script payload, copy the URL, and open it in a browser.
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.
Cross-site scripting (XSS) is a flaw where a website inserts user-supplied text into its pages without cleaning it, so an attacker can make the site run their own JavaScript. Here, a parameter called errorMessage was reflected back into the page, letting an attacker run code in a victim's browser. Because the site allowed changing the email address without the current password, that code could take over the account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.