How a Broken Email Confirmation Flow Took Over Any Shopify Store
A broken email confirmation flow let an attacker verify ownership of an email address they did not control, and a second flaw in the account merge process allowed bypassing the target account's password check. Chained together, these allowed full takeover of any Shopify merchant account, including those protected by SSO.
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Shopify merchant accounts live under myshop.myshopify.com, and the platform lets a merchant change the email address tied to an account. Like most platforms, the change is not applied immediately: the system sends a confirmation link to the new address, and the account is only updated once someone clicks that link, proving control of the inbox it landed in. The whole security of the feature rests on where that verification step anchors its trust.
The chain described here is not a single report but three linked ones from the same researcher, Ron Chan, who goes by ngalog on HackerOne. The first two are public: Email Confirmation Bypass in myshop.myshopify.com and Able to Takeover Merchants Accounts Even They Have Already Setup SSO. The first paid $16,000 with over 1,800 upvotes, the follow-up paid $15,000, and a third report that closed the one gap the first two left open paid a further $7,500.
Setup
The attack needs no privilege at all. Chan started by creating a brand-new, throwaway Shopify trial account using his own email address, something any visitor can do. The target is any existing Shopify merchant account whose email address the attacker wants to claim.
Finding it
The starting observation is about the email change flow. From inside the fresh trial account, Chan went to the account settings page and submitted a request to change the account's email to an address he did not own, one already registered to a real, existing Shopify merchant account elsewhere on the platform.
Most systems would stop there, either refusing to let you claim an email already tied to another account, or sending the confirmation link to that other account's owner. Neither happened. The confirmation link meant to verify ownership of the target email was delivered back to Chan himself, reachable from the session he already controlled, instead of ending up exclusively in the victim's inbox.

That is the whole root cause of the first report: a confirmation token generated for one email ended up reachable by whoever initiated the request, rather than strictly gated to the new address's actual owner.

Exploitation
Step 1: claim an email you do not own
- Register a free Shopify trial account with an email address you control.
- In the account settings, request a change of the account email to an address already registered to a real merchant account.
- The confirmation link for that target address is delivered back to you, reachable from the session you already control.
- Click the link. The platform treats the email as confirmed and legitimately owned.
Once the email is verified, the account-merge logic that email verification unlocks takes over. That merge logic trusted the confirmation step completely rather than re-checking who actually controlled the target account. Control of the real merchant account that owned the address became reachable from the throwaway trial account.
Step 2: bypass the password check on SSO accounts
After Shopify shipped a fix, Chan tested the patched flow against a case the first report had not covered: merchant accounts with SSO configured through Shopify's own single sign-on system. The assumption, apparently shared by the engineering team when scoping the first fix, was that SSO accounts were safer because merging into one still required entering that merchant's actual password at some point.
Walking through the merge process manually, Chan noticed that at the step meant to ask for the target account's password, the URL in the address bar followed a specific, guessable pattern, something like accounts.shopify.com/login? followed by a query string carrying the session context for that merge. His move was to leave every part of that query string untouched and change only the path portion of the URL, from /login to /accounts_merge/new-password.

That substitution dropped him straight into a password-creation screen for the account being merged into, bypassing the password check the design assumed was mandatory. The multi-step merge process was apparently tracking which step you were on purely by which URL you had navigated to, rather than verifying server-side that each step had been reached in the correct order with the correct authorisation behind it. The query string carried session identifiers that stayed valid across the entire merge flow regardless of path, so swapping the path alone was enough to skip past the one check meant to stop exactly this.
Root cause
The first bug is a trust-anchoring mistake in the email confirmation flow: the token generated for a new address is reachable by the session that initiated the request rather than being bound to the owner of the new address. Verification therefore proves nothing about control of the inbox, and the merge logic downstream trusts that verification without re-checking who controls the target account.
The second bug is a state-machine mistake in the multi-step merge. The step the user is on is tracked by the URL path rather than enforced server-side, and the session identifiers in the query string remain valid across the whole flow regardless of path. The server accepts whatever step path is handed to it as long as the session token checks out, so the password step can be skipped entirely.
Impact
Individually, either bug is a serious but bounded authentication flaw. The first hands over verified control of arbitrary email addresses, the keys to proving ownership of any account on the platform. The second closes the remaining gap that email control alone did not cover, accounts protected by SSO where a password still stood in the way. Chained, they added up to full, unauthenticated takeover of any Shopify merchant account on the platform, SSO-protected or not, starting from nothing but a free trial signup.
The general lesson about chaining: the business impact of two bugs together is rarely the sum of their individual severities, it is usually a full category higher, because the second bug exists specifically to close whatever excuse the first one left standing.
Fix
Shopify shipped a fix after the first report, and Chan then tested the patched flow against SSO accounts, which led to the second report. The third report closed the one gap the first two left open. The reports do not describe the code changes themselves. What the analysis implies should be enforced: bind the confirmation token to the owner of the new address so it cannot be reached from the initiating session, and enforce the merge step order and authorisation server-side rather than deriving the current step from the URL path.
Variants to test
- Email change on any multi-tenant platform. Register a throwaway account, request a change to an address already registered to another account, and watch where the confirmation link lands. A positive result is a link reachable from your own session for an address you do not control.
- Account merge after email verification. Once an email is verified, follow the merge flow and check whether the merge re-validates who controls the target account. A positive result is the merge proceeding on the strength of the verification alone.
- Step substitution in multi-step flows. Sit on a legitimate step of a signup wizard, checkout, account-recovery sequence or SSO merge, then substitute the URL for a different step while keeping every other parameter, cookie and token exactly as issued. A positive result is the server letting you walk straight through without re-checking that you were allowed there.
- Path swap with a stable query string. Where a step URL looks like
accounts.shopify.com/login?plus a session query string, change only the path, for example to/accounts_merge/new-password, and leave the query string untouched. A positive result is landing on a later step, such as a password-creation screen, without completing the earlier check.
Happy hunting, see you in the next scope :)
What happened, in plain words
Shopify is a platform that lets people run online shops. Every shop owner has an account on it, and that account is protected by an email address and a password. If you can prove you control the email address tied to an account, the platform treats you as the owner. That is the whole idea behind email verification: the platform sends a message to the address, and only someone who can open that message can click the link inside it.
This story is about two mistakes in that system, found by a researcher called Ron Chan, who goes by ngalog on HackerOne. HackerOne is a website where companies pay people to find security problems in their products. The first mistake let Chan receive a confirmation link that should have gone to someone else. The second mistake let him skip a password check on accounts that used a different login method called SSO. Together they let him take over any Shopify merchant account on the platform, starting from a free trial signup that anyone can create.
The chain is not one report but three linked ones. The first two are public: Email Confirmation Bypass in myshop.myshopify.com and Able to Takeover Merchants Accounts Even They Have Already Setup SSO. The first paid $16,000 with over 1,800 upvotes, the follow-up paid $15,000, and a third report that closed the one gap the first two left open paid a further $7,500.

The feature being attacked
Shopify merchant accounts live under myshop.myshopify.com. That is a web address pattern: myshop is a placeholder for the shop's own name, and myshopify.com is the domain Shopify gives every shop. When you type an address like that into a browser, the browser asks a server somewhere on the internet for a page, and the server sends it back.
The platform lets a merchant change the email address tied to an account. Like most platforms, the change is not applied immediately. The system sends a confirmation link to the new address, and the account is only updated once someone clicks that link. Clicking the link proves control of the inbox it landed in, because only the person who can read that inbox can click it.
Think of it like a bank sending a letter to a new address before it starts posting statements there. The letter is the proof that you really live at the new address. If the letter ends up in the wrong hands, the proof means nothing.
The whole security of the feature rests on where that verification step anchors its trust. In plain words: who does the system believe when it decides the link was clicked by the right person? The entire bug lived in exactly where that verification step actually anchors its trust.

Setting up the attack
The attack needs no privilege at all. Chan started by creating a brand-new, throwaway Shopify trial account using his own email address. A trial account is a free, temporary account you can open to try the product. Anyone visiting the site can create one, so the starting point of this attack is a position any random visitor can reach.
The target is any existing Shopify merchant account whose email address the attacker wants to claim.
SSO stands for single sign-on. Instead of a password stored on the shop platform, the merchant logs in through a separate identity system, and that system tells Shopify who the person is. A useful comparison is a building where the front desk checks your ID once and then gives you a badge for every door inside. The doors themselves do not ask for a password; they trust the badge.
Finding it
The starting observation is about the email change flow. A flow here means a sequence of screens you go through to get something done, like a checkout in a shop: one page, then the next, then the next.
From inside the fresh trial account, Chan went to the account settings page and submitted a request to change the account's email to an address he did not own. That address was already registered to a real, existing Shopify merchant account elsewhere on the platform.
Most systems would stop there. They would either refuse to let you claim an email already tied to another account, or send the confirmation link to that other account's owner. Neither happened. The confirmation link meant to verify ownership of the target email was delivered back to Chan himself, reachable from the session he already controlled, instead of ending up exclusively in the victim's inbox.
A session is how a website remembers who you are between page loads. When you log in, the server gives your browser a small piece of data, often called a cookie or a token, and the browser sends it back with every request. The server looks at it and says, ah, this is the person who logged in earlier. A session you control means a browser session where you are the logged-in user.
That is the whole root cause of the first report: a confirmation token generated for one email ended up reachable by whoever initiated the request, rather than strictly gated to the new address's actual owner. A token here is a long random string that acts like a claim ticket. Whoever holds the ticket can redeem it. If the ticket is handed to the wrong person, the check it was supposed to enforce is gone.

Exploitation
Step 1: claim an email you do not own
- Register a free Shopify trial account with an email address you control.
- In the account settings, request a change of the account email to an address already registered to a real merchant account.
- The confirmation link for that target address is delivered back to you, reachable from the session you already control.
- Click the link. The platform treats the email as confirmed and legitimately owned.
Why each step matters. Step 1 gives you a normal, logged-in session, which is the only thing the attack needs to start. Step 2 is the actual test: you ask the platform to trust you with an address that is not yours. Step 3 is where the bug shows itself, because the link that should have gone to the real owner comes back to you. Step 4 is the payoff: the platform now believes the address is verified, and it has no way to tell that the person who clicked was not the owner.
Once the email is verified, the account-merge logic that email verification unlocks takes over. That merge logic trusted the confirmation step completely rather than re-checking who actually controlled the target account. Control of the real merchant account that owned the address became reachable from the throwaway trial account.
Step 2: bypass the password check on SSO accounts
After Shopify shipped a fix, Chan tested the patched flow against a case the first report had not covered: merchant accounts with SSO configured through Shopify's own single sign-on system. The assumption, apparently shared by the engineering team when scoping the first fix, was that SSO accounts were safer because merging into one still required entering that merchant's actual password at some point.
Chan's second report picked that exact assumption apart. Walking through the merge process manually, he noticed that at the step meant to ask for the target account's password, the URL in the address bar followed a specific, guessable pattern, something like accounts.shopify.com/login? followed by a query string carrying the session context for that merge.
A URL is the address you see in the browser bar. It has parts. The path is the part after the domain, like /login in accounts.shopify.com/login. The query string is everything after a question mark, and it carries extra data, often identifiers that tell the server which session or which operation you are in the middle of. A guessable pattern means the shape of the URL is predictable, so you can work out what other URLs on the same site probably look like.
His move was to leave every part of that query string untouched and change only the path portion of the URL, from /login to /accounts_merge/new-password.
The first block is the URL as it appeared at the password step. The domain accounts.shopify.com is the server. The path /login is the screen the browser asked for. The query string after the question mark is the session context, and it is left exactly as issued.
The second block is the same URL with only the path changed. The domain is the same, the query string is the same, and the only difference is that the browser now asks for /accounts_merge/new-password instead of /login. The idea is to ask the server for a different screen while presenting the same session ticket, and see whether the server checks that you were supposed to be allowed there.

That substitution dropped him straight into a password-creation screen for the account being merged into, bypassing the password check the design assumed was mandatory. The multi-step merge process was apparently tracking which step you were on purely by which URL you had navigated to, rather than verifying server-side that each step had been reached in the correct order with the correct authorisation behind it.
Server-side means the check happens on the server, the machine that holds the data, before it answers. The opposite is client-side, where the check happens in your browser. A browser check is like a sign on a door saying staff only: anyone who ignores the sign can walk through. A server-side check is like a lock on the door: the server decides, and the browser cannot talk it out of the decision.
The query string carried session identifiers that stayed valid across the entire merge flow regardless of path, so swapping the path alone was enough to skip past the one check meant to stop exactly this. The session identifier is the ticket that says which merge you are in. Because it did not change when the path changed, the server accepted it at the new screen too.
Root cause
The first bug is a trust-anchoring mistake in the email confirmation flow. The token generated for a new address is reachable by the session that initiated the request rather than being bound to the owner of the new address. Verification therefore proves nothing about control of the inbox, and the merge logic downstream trusts that verification without re-checking who controls the target account.
A useful comparison is a parcel delivery. The courier is supposed to hand the parcel to the person named on the label. If the courier instead hands it to whoever filled in the order form, the signature on delivery proves nothing about the person at the address.
The second bug is a state-machine mistake in the multi-step merge. A state machine is just a way of describing a process that has steps, where each step is only allowed to follow certain other steps. A checkout is a state machine: you pick items, then pay, then get a receipt. You are not supposed to jump from picking items straight to the receipt.
The step the user is on was tracked by the URL path rather than enforced server-side, and the session identifiers in the query string remained valid across the whole flow regardless of path. The server accepted whatever step path was handed to it as long as the session token checked out, so the password step could be skipped entirely.
Impact
Individually, either bug is a serious but bounded authentication flaw. Authentication means proving who you are. The first bug hands over verified control of arbitrary email addresses, the keys to proving ownership of any account on the platform. The second closes the remaining gap that email control alone did not cover, accounts protected by SSO where a password still stood in the way.
Chained, they added up to full, unauthenticated takeover of any Shopify merchant account on the platform, SSO-protected or not, starting from nothing but a free trial signup. Unauthenticated means the attacker did not need to log in as anyone first; a free trial account is enough.
The general lesson about chaining: the business impact of two bugs together is rarely the sum of their individual severities, it is usually a full category higher, because the second bug exists specifically to close whatever excuse the first one left standing. Severity is a rough rating of how bad a bug is on its own. Two medium bugs that fit together can be worse than either one alone, because each one removes the reason the other one would have been stopped.
Fix
Shopify shipped a fix after the first report, and Chan then tested the patched flow against SSO accounts, which led to the second report. The third report closed the one gap the first two left open. The reports do not describe the code changes themselves.
What the analysis implies should be enforced: bind the confirmation token to the owner of the new address so it cannot be reached from the initiating session, and enforce the merge step order and authorisation server-side rather than deriving the current step from the URL path. In everyday terms: the parcel must go to the person on the label, and the door must have a lock, not a sign.
Variants to test
These are the same ideas applied to other products. They are worth trying because the pattern is common, not because any particular site is known to be vulnerable.
- Email change on any multi-tenant platform. A multi-tenant platform is one service shared by many separate customers, like a shopping mall with many shops. Register a throwaway account, request a change to an address already registered to another account, and watch where the confirmation link lands. A positive result is a link reachable from your own session for an address you do not control.
- Account merge after email verification. Once an email is verified, follow the merge flow and check whether the merge re-validates who controls the target account. A positive result is the merge proceeding on the strength of the verification alone.
- Step substitution in multi-step flows. Sit on a legitimate step of a signup wizard, checkout, account-recovery sequence or SSO merge, then substitute the URL for a different step while keeping every other parameter, cookie and token exactly as issued. A positive result is the server letting you walk straight through without re-checking that you were allowed there.
- Path swap with a stable query string. Where a step URL looks like
accounts.shopify.com/login?plus a session query string, change only the path, for example to/accounts_merge/new-password, and leave the query string untouched. A positive result is landing on a later step, such as a password-creation screen, without completing the earlier check.
Happy hunting, see you in the next scope :)
Glossary
- API: a way for one piece of software to ask another piece of software to do something, usually over the internet, without a human clicking buttons.
- Authentication: proving who you are, for example by logging in with an email and password.
- Authorisation: deciding what a proven user is allowed to do, for example whether they may change an account's email.
- Browser: the program you use to visit websites, such as Chrome, Firefox or Safari.
- Client-side: a check or action that happens in your browser, which you can often bypass because the browser is under your control.
- Confirmation link: a link sent to an email address to prove that someone can read that inbox.
- Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
- Domain: the part of a web address that names the server, such as
shopify.com. - Email verification: the process of proving you control an email address, usually by clicking a link sent to it.
- Flow: a sequence of screens you go through to complete a task, such as a checkout or a signup.
- HackerOne: a website where companies pay researchers to find and report security problems.
- Inbox: the place where email messages arrive for an address.
- Merge: combining two accounts that share an email address into one account.
- Multi-tenant platform: one service shared by many separate customers, each with their own account and data.
- Path: the part of a URL after the domain, such as
/login. - Privilege: the level of access an account has; a fresh trial account has almost none.
- Query string: the part of a URL after a question mark, carrying extra data such as session identifiers.
- Root cause: the underlying mistake that makes a bug possible, as opposed to its visible symptom.
- Server: the computer that holds a website's data and answers requests from browsers.
- Server-side: a check or action that happens on the server, which the browser cannot override.
- Session: the server's memory of who you are between page loads, usually carried by a cookie or token.
- Session identifier: the value in a cookie or query string that tells the server which session a request belongs to.
- Severity: a rating of how bad a security bug is on its own.
- Single sign-on (SSO): logging in through a separate identity system, which then vouches for you to other services.
- State machine: a process with defined steps, where each step is only allowed to follow certain other steps.
- Token: a long random string that acts like a claim ticket; whoever holds it can redeem it.
- Trial account: a free, temporary account for trying a product.
- Unauthenticated: done without logging in as any existing user first.
- URL: the address of a page or resource on the web, shown in the browser's address bar.
- Vulnerability: a weakness in software that someone can use to do something they are not supposed to do.