Inject page in admin panel via Shopify.API.pushState [New Payload]
A fix for an earlier report could be bypassed: a crafted postMessage to the Shopify admin window still let an attacker inject a page into the admin panel. An attacker could then use the active admin session to read the CSRF token and store configuration.
Originally disclosed on HackerOne
- Triaged in 3 hours
- Fixed in 2 months
- Paid in 22 hours
- Disclosed after 7 months
The correction for #868615, allows you to use new payload:
const ctx = window.open(location.origin+'/admin/themes', '_blank')
const data = JSON.stringify({
message: 'Shopify.API.replaceState',
data: {pathname: "abc:d../pages/xss#//"}
});
ctx.postMessage(data)
Impact
Abuse the active admin session to extract data as:
- CSRF token.
- Store config.
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 admin panel trusted postMessage data and used the supplied pathname to navigate without validating it, so a crafted path could point to an attacker-controlled page.
What the attacker needed
Victim is logged in as admin; attacker can get victim to run script
The fix
The message handler should validate the pathname and only allow expected admin routes.
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.
A page can send messages to an admin window it opened, and the admin panel changed its address based on them. A crafted path could inject a page into the admin area, letting the attacker read admin-only data.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.