H1514 CSRF in Domain transfer allows adding your domain to other user's account
A CSRF vulnerability in Shopify's domain transfer feature allowed an attacker to add their own domain to another user's store if the attacker knew the victim's myshopify.com subdomain. The attacker could transfer the domain along with its DNS records, email forwarders, and custom subdomains to the victim's store.
Originally disclosed on HackerOne
- Triaged in 12 days
- Fixed in 50 days
- Paid in 12 days
- Disclosed after 18 months
Summary:
Shopify allows users to buy their own domain from the Shopify system. One of the facility on this is that if you buy the domain through Shopify, you can do an inter-store transfers. This means:
You can only transfer your domain to a Shopify store owned by you. It can take up to 24 hours to complete the transfer.
I ended up finding a CSRF that allows adding my domain to user X's store granted I know their *.myshopify.com.
Description:
When you request for a transfer of your domain to another store, an email is sent to you with the transfer link. This link looks like this:
https://www.shopify.com/login?redirect=settings/domains/initiate_inter_shop_domain_transfer?transfer_code=6fa6d18a-d2d1-4114-b11e-236b20f81398
What I realized was that it was asking me to login to my store inorder to transfer the domain. But because this would then redirect to settings/domains and initiate transfer, I decided to check what happens if I change the link to:
After I changed the link, I saved it as a HTML tag: <img src=https://victimstore.myshopify.com/admin/settings/domains/initiate_inter_shop_domain_transfer?transfer_code=6fa6d18a-d2d1-4114-b11e-236b20f81398> and saved it as a .html file. Then, I logged into my "victim" store in incognito (no previous login to any shopify store) and opened the HTML. Soon after that the domain was transferred to the victim store.
The interesting part here is that it copies not just the domain but the DNS data as well. This not only included the MX, A, NS records but email forwarders and custom subdomains that I as an attacker would set prior to transferring.
Steps To Reproduce:
(Add details for how we can reproduce the issue)
Not sure when the transfer link expires so if this does not work, please ping me on Slack
- Edit the attached html and replace YOURSTORE with your myshopify.com domain. You will then realize that going to h1-5142.com will redirect to your store.
Impact
Domain changes to victim's store. I will look into this more in the coming week to escalate the attack further (possibly to steal store info and payment details).
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 transfer their domain, including DNS records, email forwarders and custom subdomains, into a victim's store; further escalation was not demonstrated.
What the attacker needed
Attacker owns a domain in Shopify; attacker knows victim's myshopify.com subdomain; victim clicks a link or visits a malicious page
How it was found
- Request a domain transfer to another store and receive an email with a transfer link.
- Modify the transfer link to point to the victim store's myshopify.com admin path.
- Embed the modified link in an HTML image tag and save it as an HTML file.
- Log into the victim store in a fresh incognito session and open the HTML file.
- The domain is transferred to the victim store along with its DNS records.
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 you transfer a domain between Shopify stores, the transfer link can be triggered by any website you visit, not just Shopify. This is called CSRF (Cross-Site Request Forgery): a malicious page can make your browser send a request to Shopify without you intending it. Here, an attacker could trick a victim into loading a page that silently transfers the attacker's domain into the victim's store.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.