Open redirect allows changing iframe content in *.myshopify.com/admin/themes/<id>/editor
A path traversal in the return_url parameter of the logout endpoint bypassed a fix that restricted redirects to the victim's own checkout store, allowing an attacker to redirect to their own store's 404 page. The attacker could then inject HTML/JavaScript into that page to redirect to any domain, and by loading the crafted URL in the theme editor iframe, change the iframe content.
Originally disclosed on HackerOne
- Triaged in 5 hours
- Fixed in 6 days
- Paid in 18 days
- Disclosed after 21 days
Hi ,
I managed to bypass the fix you deployed to the issue I reported in #159522. Apparently this is what the fix does:
-
Redirecting to
https://checkout.shopify.com/<exact_store_id> /only is allowed. -
For example:
victim.myshopify.com/account/logout?return_url=https://checkout.shopify.com/<victim_store_id>/will work -
but
victim.myshopify.com/account/logout?return_url=https://checkout.shopify.com/<attacker_store_id>/won't work -
https://checkout.shopify.com/<store_id>no longer follows the 302 redirect rules added in the admin dashboard.
##Redirect bypass:
<victim>.myshopify.com/account/logout?return_url=https://checkout.shopify.com/<victim_store_id>/../14467660
Note that 14467660 is the attacker's store id.
The 302 redirect no longer works , but the attacker can still inject any HTML/JavaScript code in his store's 404 page that will redirect to any domain he wants.
##Change theme editor iframe content:
Here is the PoC:
https://<your_store>.myshopify.com/admin/themes/<theme_id>/editor#/account/logout?return_url=https://checkout.shopify.com/<your_store_id>/../14467660
Thanks!
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 fix validated the return_url by checking the store ID prefix but did not normalise the path, so a '../' sequence allowed escaping to a different store ID.
Impact
An attacker could change the content of the theme editor iframe, potentially leading to further attacks, though the 302 redirect itself no longer works.
What the attacker needed
Attacker has a Shopify store; victim clicks a crafted link
How it was found
- The fix only allows redirects to the victim's own checkout store ID.
- The attacker uses a return_url with '../' followed by their own store ID to bypass the check.
- The attacker injects HTML/JavaScript into their store's 404 page to redirect to any domain.
- The attacker loads the crafted URL in the theme editor iframe to change its content.
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 you log out, the site can send you back to a page you came from using a 'return_url' parameter. The fix only allowed redirects to the victim's own store checkout, but by adding '../' (a path traversal trick) the attacker could point to their own store instead. The attacker's store page could then run code to send the victim anywhere, and because the theme editor loads that URL in a frame, the attacker could control what appears inside it.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.