Racing an Email Verification to Hijack an Admin Invite
A pending admin invite was bound to an email address rather than a verified identity, and an email verification link could be raced against a second email change so the link verified an address it was never issued for. A low-privileged user could thereby inherit the invited admin role.
medium.com
Published on medium.com
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
This write-up is about a class of flaw in invitation flows rather than a single named product. The pattern appears when an admin invites an address such as [redacted] to their organisation and the product does not create an account at that moment. Instead it stores a pending invite keyed to the email string. Later, whenever an account's email becomes that address, the invite auto-attaches and grants its role.
The design assumes that whoever ends up holding the invited email is the intended person. Authority is bound to an email string, not to a verified identity. If a low-privileged user can make their own email equal the invited address, they inherit an invite that was never meant for them.
Setup
The scenario needs four preconditions, all of which have to hold before the race is worth attempting:
- An invite flow accepts an email that has no account yet, so the invite sits pending.
- An account can change its own email.
- An email change requires a verification link, so an address cannot simply be set instantly.
- The invite auto-attaches to whatever account's email becomes the invited one.
If email changes bind instantly with no verification, there is no race to run: change the email to the invited address and claim the invite directly. The race exists only to defeat the verification step in requirement 3.
Finding it
Verification is the control that is supposed to stop this. To make an account's email [redacted], you would need to click a link sent to that inbox, which you do not control. The race works by applying a held verification link after the account's email has been changed to the invited address. That gap is a time-of-check to time-of-use (TOCTOU) problem on email verification: the race sidesteps the control by verifying an address the link was never issued for.
Exploitation
Step 1: change to an address you own and hold the link
As a low-privileged user, change the account email to an address you control, for example [redacted]. A genuine verification link arrives in that inbox. Do not click it yet; hold it.
Step 2: change to the invited address
Change the email again, this time to the pending invited address, for example [redacted].
Step 3: send both requests in parallel
Fire two requests at the same time:
- apply the held verification link, which was issued for
temp@, and - the email change to
[redacted].
Step 4: the link lands on the new address
Inside the race window, the held link is applied to the account whose email is now [redacted]. The verification succeeds for an address the link was never issued for.
Step 5: the invite attaches
The invite flow sees a verified account whose email equals the invited address and auto-attaches. The account now holds the invited role.
The tell
After the parallel burst, the account's role equals the invited role and the verified email equals the invited address. A single success that does not reproduce is jitter, not a finding: re-run the burst and confirm it repeats before believing it.

Root cause
The design binds authority to an email string rather than to a verified identity, and the verification step does not appear to tie the link to the address it was issued for when the link is redeemed. Because the email change and the verification are separate operations, a link issued for one address can be applied after the account has moved to another. The pending invite then matches on the email string alone and grants its role.
Impact
An attacker holding a low-privileged account can inherit a pending invite that was addressed to someone else, including an admin invite, provided the four preconditions above hold and the race window can be hit reliably. The result is that the attacker's account holds the invited role. The report does not describe any specific product, version or bounty amount, so the impact here is the general privilege escalation from a low-privileged account to the invited role.
Fix
The report does not state what was changed.
Variants to test
What happened, in plain words
This write-up is not about one named product. It describes a pattern that shows up in the invitation flows of many products, and it explains how a low-privileged user can end up holding an invitation that was meant for someone else, including an admin invitation.
An invitation flow is the feature that lets an existing member of a team or organisation ask another person to join. The admin types an email address and the product stores a pending invite for it. That role might be a normal member, or it might be an administrator with far more power.
Here is the pattern. An admin invites [redacted] to their organisation. At that moment the product does not create an account for that address. Instead it stores a pending invite: a record that says "if an account with this email address ever appears, give it this role". The invite is keyed to the email string, meaning the text of the address itself is the thing the product matches on.
Later, whenever some account's email becomes that address, the invite auto-attaches and grants its role. The product assumes that whoever ends up holding the invited email is the person the admin meant to invite.
That assumption is the flaw. The product binds authority to an email string, not to a verified identity. An email string is just text; a verified identity means the product has checked that the person really controls that inbox. If a low-privileged user can make their own account's email equal the invited address, they inherit an invite that was never meant for them.
The tool used to get there is a race condition, specifically a time-of-check to time-of-use (TOCTOU) problem. A useful everyday comparison: a shop assistant checks your receipt at the door (the check), and by the time you reach the till (the use) you have swapped the goods in your bag. The check and the use happen at different moments, and nothing ties them together. Here the check is the email verification step and the use is the moment the invite decides to attach.
The fingerprint: when to even try this
Before spending time on a target, the write-up lists four conditions. All four have to hold. Think of them as a fingerprint that tells you the bug is possible at all.
- An invite flow accepts an email that has no account yet, so the invite sits pending.
- An account can change its own email.
- An email change requires a verification link, so an address cannot simply be set instantly. A verification link is a special URL sent to the new inbox; clicking it proves you can read mail at that address. This condition is what creates the race, because it is the obstacle the race is designed to get around.
- The invite auto-attaches to whatever account's email becomes the invited one.
There is an important shortcut in the write-up. If email changes bind instantly with no verification, there is no race to run at all: change the email to the invited address and claim the invite directly. The race exists only to defeat the verification step in requirement 3.
The race: a TOCTOU on email verification
Verification is the control that is supposed to stop this. To make an account's email [redacted], you would need to click a link sent to that inbox, and you do not control that inbox.
The observation behind the finding is that the verification step and the email-change step are separate operations. The race applies a held verification link after the account's email has changed. So a link that was legitimately issued for one address can be redeemed after the account has moved to a different address, and it verifies the new one.
The exploitation runs in five steps.
Step 1: change to an address you own and hold the link
As a low-privileged user, change the account email to an address you control, for example [redacted]. A genuine verification link arrives in that inbox. Do not click it yet; hold it.
Why this step: you need a real, valid verification link that the product itself issued. You get one honestly, for an address you genuinely own, so nothing about this step is suspicious to the product. Holding it rather than clicking it is the whole trick: the link stays unused and valid while you change the account underneath it.
Step 2: change to the invited address
Change the email again, this time to the pending invited address, for example [redacted].
Why this step: this moves the account's email string onto the address the pending invite is waiting for. On its own this does nothing, because the new address is not verified yet. The product will not treat the account as holding that address until verification succeeds.
Step 3: send both requests in parallel
Fire two requests at the same time:
- apply the held verification link, which was issued for
temp@, and - the email change to
[redacted].
Why this step: this is the race. The two operations are separate, and the product does not tie the link to the address it was minted for. By sending them together you are trying to land the verification while the account is already on the invited address, so the check passes against the wrong state.
Step 4: the link lands on the new address
Inside the race window, the held link is applied to the account whose email is now [redacted]. The verification succeeds for an address the link was never issued for.
If the timing lines up, the link is redeemed after the email has changed, and the product marks the invited address as verified even though nobody ever read mail at that inbox.
Step 5: the invite attaches
The invite flow sees a verified account whose email equals the invited address and auto-attaches. The account now holds the invited role.
Why this step matters: this is the payoff. The pending invite was waiting for an account with that email string, and now one exists, and it is marked verified. The product hands over the role, which in the admin case is a serious privilege escalation from a low-privileged account.
The tell
After the parallel burst, the account's role equals the invited role and the verified email equals the invited address. Those two facts together are the signal that the race worked.
A single success that does not reproduce is jitter, not a finding: re-run the burst and confirm it repeats before believing it. Race conditions are timing-dependent, so one lucky hit can be coincidence. A finding is something you can make happen again on demand.

Root cause
The design binds authority to an email string rather than to a verified identity. The verification step does not appear to tie the link to the address it was issued for when the link is redeemed. Because the email change and the verification are separate operations, a link issued for one address can be applied after the account has moved to another. The pending invite then matches on the email string alone and grants its role.
In plain terms: the product asks "is this link valid for this account right now?" instead of "was this link issued for the address this account is claiming?"
Impact
An attacker holding a low-privileged account can inherit a pending invite that was addressed to someone else, including an admin invite, provided the four preconditions above hold and the race window can be hit reliably. The result is that the attacker's account holds the invited role.
The write-up does not describe any specific product, version or bounty amount, so the impact here is the general privilege escalation from a low-privileged account to the invited role. Privilege escalation means moving from a position with little power to one with more, without being granted it.
Fix
The write-up does not state what was changed.
In everyday terms: the shop assistant should check that the receipt matches the goods in your bag at the till, not just glance at it at the door.
Variants to test
These are related checks worth trying on a target, each with a clear positive result.
Glossary
- Invitation flow: the product feature that lets an existing member invite someone else to join a team or organisation with a chosen role.
- Pending invite: a stored invitation for an email address that has no account yet, waiting to be claimed.
- Email string: the text of an email address, treated as plain data rather than as proof of who controls the inbox.
- Verified identity: an account whose control of an email address the product has actually checked.
- Auto-attach: the product automatically granting an invite's role to an account once its email matches the invited address, with no manual approval.
- Verification link: a special URL sent to an email inbox; opening it proves you can read mail at that address.
- Race condition: a bug where the result depends on the exact timing of two operations happening close together.
- TOCTOU (time-of-check to time-of-use): a race where a check is made at one moment and the thing checked changes before it is used.
- Race window: the short slice of time in which the timing lines up and the race can succeed.
- Privilege escalation: gaining more power or access than your account was granted.
- Role: the set of permissions an account has, such as member or administrator.
- Root cause: the underlying design or coding mistake that makes the bug possible.
- Burst: sending a group of requests together in a short space of time.
- Jitter: timing variation that makes a result happen once by luck rather than reliably.