Shopify · Report #226428
Reflected XSS in <any>.myshopify.com through theme preview
Summary
This is a reflected XSS that could be triggered on the storefront of any Shopify store. Our template was missing proper escaping for the theme_handle parameter. This issue is severe because it could be exploited by unauthenticated users to attack the admin area of a store, given that the storefront is hosted on the same origin as the admin area of a store.
How it was found
Hi,
I have found a reflected cross site scripting vulnerability in <any>.myshopify.com through theme_hanlde parameter due to not single quotes.
#Steps to reproduce:
- Navigate to
<account>.myshopify.com - view the source of the page and copy the value of
Shopify.themeId. - Navigate to
https://echo.myshopify.com/?theme_handle=xx%27-alert(document.cookie)-%27&style_id=1&style_handle=1&preview_theme_id=<theme_ID>
replace
<theme_ID>with the ID you just copied.
- XSS will trigger in all of the online shop pages unless you click
Cancel theme preview.
PoC:
https://test.myshopify.com/?theme_handle=xx%27-alert(document.cookie)-%27&style_id=1&style_handle=1&preview_theme_id=3572
{F182252} Thanks!