Skip to content
XSS Disclosed report Advanced

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.

tiago-danin Follow

Originally disclosed on HackerOne

Bounty$500 Low View original
  • 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:

JavaScript
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.

The original report as published on HackerOne, by tiago-danin. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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.

More by tiago-danin

View all

4 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.