Skip to content
Race condition Disclosed report Intermediate

Ability to bypass partner email confirmation to take over any store given an employee email

A race condition in the email change and verification logic allowed an attacker to confirm an email address they did not own. By confirming a store employee's email on a partner account, the attacker could add the store as a managed store and gain collaborator access without merchant interaction.

cache-money Follow

Originally disclosed on HackerOne

Bounty$15,250incl. $250 bonus Critical 10.0 View original
  • Triaged in 5 hours
  • Fixed in 18 days
  • Paid in 41 days
  • Disclosed after 45 days

Summary by the program

@cache-money reported it was possible to bypass the email verification process in our Partners Dashboard. Doing so would have allowed a Partner to request access to a store under an email address the Partner did not own. If the store had a staff account associated with that email address, the staff account would have been automatically converted to a "collaborator" account and added to the Partner's dashboard without any merchant interaction.

We tracked down the bug to a race condition in the logic for changing and verifying email addresses. We fixed it by locking the database record during those actions and requiring store administrators to approve all collaborator requests.

Summary by the researcher

After reading Shopify's summary from #270981 a few of times I was able to replicate the intended behavior. Seeing how it worked, I realized the core behavior to investigate was the automatic conversion aspect of it. In order for the conversion to work, you needed to confirm a store employee's email on a partner account. From there you could add the store on the partner account as a "managed store", which will then perform the automatic conversion and give you collaborator access. The bug existed in the email confirmation, which allowed me to confirm arbitrary emails under my partner account via race condition.

The bug was filed on Christmas Eve, and within 12 hours the Shopify team rolled out a fix to address the immediate issue. It was a pleasure to work with a team that takes security as seriously as they do.

The report

I told Pete I would take a look at Spotify, hi Pete.

Summary It's possible to take over any store account through partners given an employee email address. This is possible because I found a way to confirm arbitrary emails. I don't know the Shopify ecosystem well enough to know the other ramifications of such a bug.

On #270981 you wrote:

The intention was that, when a partner already had a valid user account on the store, their collaborator account request could be accepted automatically, with the user account converted into a collaborator account.

I tested that functionality and confirmed how it works. I realized that if you can somehow create a partner account with a business email that matched that of an employee, you would be able to take over their employee account, then convert it to a collaborator. The problem is that business accounts need emails to be validated, but this can be bypassed with a race condition.

The bug works by hitting the email validation endpoint for an email you own, at the same time as changing your email to a victim's. It might take a few tries, but eventually your email will be changed and be validated due to not (properly) using a DB transaction.

Steps to reproduce

  1. Create a store account and invite an employee.
  2. Accept the employee invite (maybe not necessary I didn't test).
  3. Login to or create a partner account as the attacker.
  4. Go to your partner settings page https://partners.shopify.com/[ID]/settings and change your email to something you own.
  5. Check your email and grab the confirmation link, but don't visit it yet.
  6. Go back to your partner account and change your email to that of the store employee from step 2, but intercept the request to not let it through yet.
  7. Now the tricky part. The "change email" takes anywhere from 1,100 - 2,500 ms to load so you need to take that into account. But let the request go through, wait for some milliseconds, then in another tab visit that email confirmation link from step 5.
  8. If done correctly you will now have confirmed an email you do not own.
  9. Visit https://partners.shopify.com/[ID]/managed_stores, add the store, and you now have access.

As proof, look at the email for partner account 698396. It will be confirmed [email protected], which I obviously would never be able to validate otherwise.

Thanks, -- Tanner

Impact

Ability to take over stores, and possibly perform any other action that relies on a validated email as a security measure.

The original report as published on HackerOne, by cache-money. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Shopify runs a Partners programme whose dashboard lives at partners.shopify.com. Partners can attach stores to their partner account, and one of the features around this is the "managed store" flow. When a partner adds a store as a managed store, Shopify checks whether the partner already holds a valid user account on that store. If the partner's account email matches a staff account on the store, the staff account is automatically converted into a collaborator account and added to the partner's dashboard, with no merchant interaction required.

The feature therefore treats a validated email address as proof of identity: if you can prove you control the email that belongs to a store employee, the platform will hand you collaborator access to that store. The report is about breaking the validation step, not the conversion step.

Setup

To reproduce the issue you need:

  1. A store account with an employee invited (the researcher notes that accepting the employee invite may not be necessary, as he did not test it).
  2. A partner account controlled by the attacker.
  3. The ability to intercept and hold an HTTP request in a proxy, so the email change request can be delayed.
  4. An email address the attacker genuinely owns, to receive a confirmation link.

No special tooling beyond a request interceptor is described. The timing figures in the report are the only version-like detail: the "change email" action takes roughly 1,100 to 2,500 ms to complete.

Finding it

The researcher started from Shopify's summary of report #270981 and its explanation of the intended behaviour:

The intention was that, when a partner already had a valid user account on the store, their collaborator account request could be accepted automatically, with the user account converted into a collaborator account.

After reading that summary several times he replicated the intended behaviour and concluded that the interesting part was the automatic conversion. The conversion only fires when a store employee's email is confirmed on a partner account. From there the store can be added on the partner account as a managed store, which triggers the conversion and grants collaborator access.

That made the email confirmation the place to attack. Business accounts require emails to be validated, so the question became whether validation could be defeated. The researcher found that it could, through a race condition, allowing arbitrary emails to be confirmed under his own partner account.

Exploitation

The mechanism is a race: the email validation endpoint is hit for an address the attacker owns while the account email is being changed to the victim's address. The report states that it might take a few tries, but eventually the email is changed and validated because a database transaction is not (properly) used.

Step 1: Create the store and invite an employee

Create a store account and invite an employee. Accepting the invite is listed as possibly unnecessary; the researcher did not test that variant.

Step 2: Prepare the attacker's partner account

Log in to, or create, a partner account as the attacker.

Step 3: Set the partner email to an address you own

Go to the partner settings page:

Text
https://partners.shopify.com/[ID]/settings

and change the email to something you own. [ID] is the partner account identifier in the path.

Step 4: Capture the confirmation link without using it

Check the mailbox for the address you own and grab the confirmation link, but do not visit it yet. This link is the artefact that will later be replayed against a different email value.

Step 5: Start changing the email to the victim's address and hold the request

Go back to the partner account and change the email to that of the store employee from step 1, but intercept the request so it is not sent yet.

Step 6: Release the request and race the confirmation link

This is the timing-sensitive part. The "change email" action takes anywhere from 1,100 to 2,500 ms to load, and that has to be taken into account. Let the intercepted request go through, wait some milliseconds, then in another tab visit the confirmation link captured in step 4.

If the timing is right, the confirmation link issued for the attacker's own address validates the account while the email value has already been switched to the employee's address. The result is a confirmed email the attacker does not own.

Step 7: Add the store as a managed store

Visit:

Text
https://partners.shopify.com/[ID]/managed_stores

add the store, and the automatic conversion runs: the employee's staff account becomes a collaborator account on the attacker's partner dashboard.

Proof

The researcher pointed at partner account 698396, whose email is confirmed as [redacted], an address he states he would never be able to validate otherwise.

Root cause

The email change and the email verification are two separate operations that are not executed inside a single database transaction. The email change and the email verification are not executed inside a single database transaction, so the confirmation can end up applying to a different address. Because the two actions are not handled transactionally, the confirmation issued for one address ends up marking a different address as confirmed.

The existing defence was the requirement that business accounts validate their email before the automatic conversion can be used. That defence assumes the validated address is the address the account actually holds, and the race breaks that assumption. The report attributes the flaw to the email confirmation not (properly) using a database transaction.

Impact

An attacker who knows an employee's email address for a store can take over that store account. The conversion path adds the attacker as a collaborator on the store without any merchant interaction, because the platform treats the confirmed email as sufficient proof. The researcher notes that he does not know the Shopify ecosystem well enough to enumerate the other ramifications, and states that the bug could enable any other action that relies on a validated email as a security measure.

The precondition is an employee email address for the target store, plus a partner account and the ability to win the race.

Fix

Shopify traced the bug to a race condition in the logic for changing and verifying email addresses and applied two changes:

  1. Locking the database record during those actions, so the change and the verification cannot interleave.
  2. Requiring store administrators to approve all collaborator requests, so the automatic conversion no longer grants access on its own.

A fix for the immediate issue was rolled out within 12 hours of the report being filed on Christmas Eve.

  1. Other confirmation flows with a mutable identifier. Any feature where a token is issued for one value (email, phone, domain) and consumed after that value can change. A positive result is a confirmation landing on a value you never controlled.
  2. Email change combined with password reset or invitation acceptance. Hold the change request, trigger the other flow, then release. A positive result is a reset or invite completing against the new address.
  3. Parallel requests rather than a held request. Fire the change and the confirmation simultaneously in many iterations. A positive result is any single run where the confirmed value differs from the value the token was issued for.
  4. Multi-step wizards where the token is minted early. Look for flows that create a verification token before the final save. A positive result is the token surviving a change of the underlying field.
  5. Automatic trust decisions keyed on a verified attribute. Wherever a verified email or domain triggers an automatic grant, test whether the verification can be attached to a different value. A positive result is an automatic grant to an identity you do not control.

This class of bug hides in flows that split a security decision across two requests: issue a token for value A, then let value A be replaced before the token is consumed. The signals during recon are features that send a confirmation link and separately allow the confirmed attribute to be edited, especially where the edit is slow enough to leave a window. The report's own timing observation, 1,100 to 2,500 ms for the change action, is the kind of measurement worth taking, because it tells you how wide the window is.

Impact was demonstrated by pointing at a concrete partner account whose confirmed email was an address the researcher could not otherwise validate, and by walking the chain from that confirmed email through the managed store flow to collaborator access.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

Shopify is a platform that lets people run online shops. Around it sits a programme called Shopify Partners: a separate dashboard at partners.shopify.com where agencies, developers and freelancers manage the shops they work on. A partner account can have shops attached to it, and one way to attach a shop is the "managed store" feature.

When a partner adds a shop as a managed store, Shopify checks something: does this partner already have a user account on that shop? If the email address on the partner account matches the email of a staff account on the shop, Shopify does something convenient. It turns that staff account into a "collaborator" account and adds it to the partner's dashboard, without the shop owner having to click anything.

That convenience rests on one assumption: a confirmed email address proves who you are. If you can prove you control the email address that belongs to a shop employee, the platform will hand you collaborator access to that shop.

The researcher found a way to confirm an email address he did not own. He did it by exploiting a race condition, which is a timing flaw: two actions that should happen one after the other are allowed to overlap, and the system gets confused about which one is true. With a confirmed employee email on his partner account, he could add the shop as a managed store and be granted collaborator access to it.

Shopify's own summary says the bug was a race condition in the logic for changing and verifying email addresses. They fixed it by locking the database record during those actions and by requiring shop administrators to approve all collaborator requests.

The report was filed on Christmas Eve, and Shopify rolled out a fix for the immediate issue within 12 hours.

The pieces you need to understand first

Before walking through the steps, here are the ideas the report leans on. Each one is explained from zero.

Partner account. A login on partners.shopify.com. It belongs to an agency or developer, not to a shop. It has settings, including an email address, and it can have shops attached to it.

Store account and staff account. A shop on Shopify has its own account, and the people who work in it have staff accounts, each with an email address. An employee is invited by email and accepts the invitation to get a staff account.

Collaborator. Someone from outside the shop, typically an agency, who is given access to work on the shop. A collaborator account is attached to a partner dashboard.

Managed store. A shop that a partner has attached to their partner account so they can manage it. Adding a shop as a managed store is the action that triggers the automatic conversion described above.

Email confirmation (validation). When you sign up or change your email, the platform sends a link to that address. Clicking the link proves you can read mail sent to it. Until you click, the address is unconfirmed. This is the security measure the whole report is about.

API endpoint. A URL that a web page talks to behind the scenes to do something, such as save a new email address. You do not see it as a page; the browser sends a request to it. When the report says the researcher "hit the email validation endpoint", it means he sent a request to the URL that handles confirmation links.

HTTP request. The message your browser sends to a server: "please give me this page" or "please save this change". A request can be paused in transit.

Proxy / request interceptor. A tool that sits between your browser and the server and lets you pause a request, look at it, change it, and then let it go. Think of it as a mail sorting office where you can hold a letter in your hand before posting it. The researcher uses one to hold the email change request back while he does something else.

Race condition. A bug where the result depends on the exact order and timing of two operations that run close together. Everyday comparison: two people try to book the last seat on a plane at the same moment. The system checks the seat is free, then both bookings arrive, and both get a seat. The check and the use happened at different times, and reality changed in between.

Time-of-check to time-of-use (TOCTOU). The formal name for that pattern. The system checks a value at one moment (time of check) and acts on it at a later moment (time of use). If the value can change in between, the action can be based on stale information.

Database transaction. A way of grouping several database changes so they either all happen or none happen, and so nothing else can slip in between. Without one, two operations can interleave and produce a state nobody intended. The report says the problem was that a transaction was not (properly) used.

Locking a database record. Making a row in the database unavailable to other operations while one operation is working on it. It is the fix Shopify applied: while the email is being changed or verified, nothing else can touch that record.

Milliseconds (ms). Thousandths of a second. 1,000 ms is one second. The report's timing figures, 1,100 to 2,500 ms, are therefore roughly one to two and a half seconds.

Setting up

To reproduce the issue you need four things:

  1. A store account with an employee invited. The researcher notes that accepting the employee invitation may not be necessary, because he did not test that variant.
  2. A partner account controlled by the attacker.
  3. A way to intercept and hold an HTTP request, so the email change request can be delayed.
  4. An email address the attacker genuinely owns, to receive a confirmation link.

No special tooling beyond a request interceptor is described. The only timing detail in the report is that the "change email" action takes roughly 1,100 to 2,500 ms to complete.

Finding it

He started from Shopify's summary of an earlier report, #270981, and its explanation of how the feature was meant to work:

The intention was that, when a partner already had a valid user account on the store, their collaborator account request could be accepted automatically, with the user account converted into a collaborator account.

That quote is the design intent: if the partner already has an account on the shop, the collaborator request can be accepted automatically, and the existing user account becomes a collaborator account.

He read that summary several times, then replicated the intended behaviour himself to see it work. Having seen it, he decided the interesting part was the automatic conversion. The conversion only fires when a shop employee's email is confirmed on a partner account. Once that is true, the shop can be added on the partner account as a managed store, which triggers the conversion and grants collaborator access.

So the email confirmation became the place to attack. Business accounts require emails to be validated, which is the defence. The question was whether that validation could be defeated. The researcher found that it could, through a race condition, letting him confirm arbitrary emails under his own partner account.

Exploitation, step by step

The mechanism is a time-of-check to time-of-use problem. The email validation endpoint is hit for an address the attacker owns at the same moment the account email is being changed to the victim's address. The report says it might take a few tries, but eventually the email is changed and validated, because a database transaction is not (properly) used.

Step 1: Create the store and invite an employee

Create a store account and invite an employee. Accepting the invitation is listed as possibly unnecessary; the researcher did not test that variant. The point of this step is to have a shop that has a staff account with a known email address, because that email is what the attack will later pretend to confirm.

Step 2: Prepare the attacker's partner account

Log in to, or create, a partner account as the attacker. This is the account whose email address will be manipulated. It is the attacker's own account, so he can change its settings freely.

Step 3: Set the partner email to an address you own

Go to the partner settings page:

Text
https://partners.shopify.com/[ID]/settings

and change the email to something you own. [ID] is the partner account identifier in the path, a number that identifies which partner account the page belongs to.

Why this step: the platform will send a confirmation link to this address. Because the attacker owns it, he can read the link. That link is the object he will later use at the wrong moment.

Step 4: Capture the confirmation link without using it

Check the mailbox for the address you own and grab the confirmation link, but do not visit it yet. This link is the artefact that will later be replayed against a different email value.

Why this step: the link is a token, a one-time pass that says "this person can read mail at this address". By not clicking it yet, the attacker keeps the pass unused. The plan is to use it while the account's email field says something else.

Step 5: Start changing the email to the victim's address and hold the request

Go back to the partner account and change the email to that of the store employee from step 1, but intercept the request so it is not sent yet.

Why this step: the change request is the second half of the race. Holding it means the attacker controls exactly when the server learns about the new email address. The proxy is the hand that keeps the letter from being posted.

Step 6: Release the request and race the confirmation link

This is the timing-sensitive part. The "change email" action takes anywhere from 1,100 to 2,500 ms to load, and that has to be taken into account. Let the intercepted request go through, wait some milliseconds, then in another tab visit the confirmation link captured in step 4.

Why this step: the server is now processing two things at once. One request is writing the employee's address into the account. The other request, the confirmation link, is checking and marking an address as confirmed. If the confirmation lands while the account already holds the employee's address, the confirmation issued for the attacker's own address ends up marking the employee's address as confirmed. The result is a confirmed email the attacker does not own.

The window is short, which is why the report says it might take a few tries. The 1,100 to 2,500 ms figure is the measurement of how long the change takes, and therefore roughly how wide the window is.

Step 7: Add the store as a managed store

Visit:

Text
https://partners.shopify.com/[ID]/managed_stores

add the store, and the automatic conversion runs: the employee's staff account becomes a collaborator account on the attacker's partner dashboard.

Why this step: this is where the confirmed email is cashed in. The platform sees a partner account whose confirmed email matches a staff account on the shop, and by design it converts that staff account into a collaborator without asking the shop owner. The attacker now has collaborator access to a shop he does not work for.

Proof

The researcher pointed at partner account 698396, whose email is confirmed as [redacted], an address he states he would never be able to validate otherwise. In other words, the account shows a confirmed address that the attacker could not legitimately prove he controls, which is the visible trace of the race having worked.

Root cause

The email change and the email verification are two separate operations that are not executed inside a single database transaction. The verification endpoint checks and acts on the email value at one moment, while the change request is still in flight and later commits a different value. Because the record is not locked across the two actions, the confirmation issued for one address ends up marking a different address as confirmed.

The existing defence was the requirement that business accounts validate their email before the automatic conversion can be used. That defence assumes the validated address is the address the account actually holds. The race breaks that assumption. The report attributes the flaw to the absence of proper transactional handling, not to a logic error in the conversion itself.

Impact

An attacker who knows an employee's email address for a shop can take over that shop account. The conversion path adds the attacker as a collaborator on the shop without any merchant interaction, because the platform treats the confirmed email as sufficient proof. The researcher notes that he does not know the Shopify ecosystem well enough to list the other consequences, and states that the bug could enable any other action that relies on a validated email as a security measure.

The precondition is an employee email address for the target shop, plus a partner account and the ability to win the race.

Fix

Shopify traced the bug to a race condition in the logic for changing and verifying email addresses and applied two changes:

  1. Locking the database record during those actions, so the change and the verification cannot interleave.
  2. Requiring shop administrators to approve all collaborator requests, so the automatic conversion no longer grants access on its own.

The immediate issue was addressed within 12 hours of the report being filed on Christmas Eve.

Variants to test

  1. Other confirmation flows with a mutable identifier. Any feature where a token is issued for one value (email, phone, domain) and consumed after that value can change. A positive result is a confirmation landing on a value you never controlled.
  2. Email change combined with password reset or invitation acceptance. Hold the change request, trigger the other flow, then release. A positive result is a reset or invitation completing against the new address.
  3. Parallel requests rather than a held request. Fire the change and the confirmation simultaneously in many iterations. A positive result is any single run where the confirmed value differs from the value the token was issued for.
  4. Multi-step wizards where the token is minted early. Look for flows that create a verification token before the final save. A positive result is the token surviving a change of the underlying field.
  5. Automatic trust decisions keyed on a verified attribute. Wherever a verified email or domain triggers an automatic grant, test whether the verification can be attached to a different value. A positive result is an automatic grant to an identity you do not control.

Hunting notes

During recon, the signals are features that send a confirmation link and separately allow the confirmed attribute to be edited, especially where the edit is slow enough to leave a window.

Impact was demonstrated by pointing at a concrete partner account whose confirmed email was an address the researcher could not otherwise validate. That chain, rather than the race alone, is what shows the bug reaches shop takeover.

Glossary

  • API endpoint: a URL that a web page talks to behind the scenes to perform an action, such as saving a new email address.
  • Collaborator: an outside person, usually from an agency, given access to work on a shop.
  • Confirmation link: a link sent by email that, when visited, proves you can read mail at that address.
  • Database record: one row of stored data, for example the row holding a partner account's email address.
  • Database transaction: a way of grouping database changes so they all happen together or not at all, with nothing slipping in between.
  • Email validation / confirmation: the process of proving you control an email address by clicking a link sent to it.
  • HTTP request: the message a browser sends to a server asking for a page or asking it to save a change.
  • Locking a record: making a database row unavailable to other operations while one operation is working on it.
  • Managed store: a shop attached to a partner account so the partner can manage it.
  • Millisecond (ms): one thousandth of a second; 1,000 ms is one second.
  • Mutable identifier: a value that can be changed, such as an email address, as opposed to one that is fixed.
  • Partner account: a login on partners.shopify.com belonging to an agency or developer rather than to a shop.
  • Proxy / request interceptor: a tool that sits between browser and server and can pause, inspect, alter and release requests.
  • Race condition: a bug where the outcome depends on the exact timing and order of two operations running close together.
  • Recon: the research phase where you look at a product's features to spot where bugs might hide.
  • Staff account: a user account belonging to an employee of a shop.
  • Time-of-check to time-of-use (TOCTOU): a flaw where a value is checked at one moment and used at a later moment, and can change in between.
  • Token: a one-time pass, here the confirmation link, that proves a specific claim when presented.
  • Wizard: a multi-step form where you fill in several screens before the final save.

More by cache-money

View all

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

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.