$500 Bounty on Reflected XSS on Shopify
The returnTo parameter on a Shopify help page accepted a javascript: URL, so after login and pressing back, the script executed in the user's browser. An attacker could run arbitrary JavaScript in the victim's session, and the same parameter also allowed open redirects.
medium.com
Published on medium.com
XSS stands for Cross Site Scripting. It is a vulnerability in web application where the attacker injects a malicious payload into the code of a website to gather valuable information of the victim or to lure the victim to take different action.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could execute arbitrary JavaScript in the context of the Shopify help site after a victim logs in, potentially stealing session data or performing actions as the victim; the same parameter also allowed open redirects.
What the attacker needed
An unverified account; victim logs in; victim presses back button
The fix
The report was accepted and a bounty was awarded, but the text does not describe the fix; it should be fixed by validating the returnTo parameter to allow only safe, relative URLs or an allowlist of trusted destinations.
How it was found
- Open the confirm-account-details link with a returnTo value that is a javascript: URL.
- Log in when prompted.
- Press the back button to return to the crafted URL.
- The JavaScript code executes.
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 write-up has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when a website takes input from a user and puts it into a page without making it safe, so an attacker can make the site run their own code. Here, a link parameter called returnTo was supposed to send you to another page after login, but it accepted a javascript: link, which runs code instead of navigating. The attacker tricks a logged-in user into visiting the crafted link, and then the code runs as that user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.