Skip to content
Account takeover Write-up Intermediate

# Forced Team Membership via Invitation Token Leakage and Missing Email Ownership Verification

Invitation tokens were exposed in API responses and were not bound to their intended invitation context, and registration did not verify email ownership. An attacker could pre-register an account with a victim's email address and force that identity into an attacker-controlled team, which the victim would inherit after a password reset.

zyadatef2462003 Follow

Published on medium.com

Bug Bounty

Zyadatef, on medium.com

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.

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

The target is a platform with a team feature: users can create teams, invite other people by email address, and those invitees go through an invitation link into an account registration flow. Membership in a team is what grants a user the ability to act inside that team.

The researcher tested the invitation and registration functionality together and found that the two flows, combined, let an attacker attach an arbitrary victim email address to an attacker-controlled team without the victim ever accepting anything. The write-up describes the chain as several separate weaknesses that only become serious when combined:

  • Invitation tokens were exposed in API responses.
  • Invitation tokens were not sufficiently bound to their intended invitation context.
  • Account registration did not require email ownership verification.
  • The invitation flow did not properly validate ownership of the invited email address.
  • Team membership could be established before the email identity was verified.

The end state is that the victim's email identity is pre-claimed inside the application, and when the real owner later recovers the account through the normal password reset, they find themselves already a member of the attacker's team.

Setup

The write-up does not name the program, the product or any software versions. The only concrete setup detail is that the researcher created or controlled a team on the platform and used the normal team invitation functionality to invite an email address. For the proof of concept a victim-controlled email address was used. No specific tooling is described.

Finding it

The researcher was testing the team invitation and account registration functionality. Two observations drove the rest of the work:

  1. When an invitation was sent, the invitation API response contained a sensitive invitation token/code. The application used that token as part of invitation validation and activation.
  2. A previously generated invitation link could be used together with another invitation token obtained from an API response. By replacing the token inside the existing invitation link, the invitation flow could be manipulated so the resulting invitation was associated with the target invitation.

That second point is the interesting one: the token was not sufficiently bound to the intended recipient and invitation context, so a token from one invitation could be dropped into the link of another. From there the researcher checked whether the manipulated invitation could carry the flow all the way through registration, and found that an account could be registered with the victim's email address without proving ownership of that mailbox.

Exploitation

The attack chain, as summarised in the write-up:

Text
Attacker-controlled Team
→ Send invitation to victim email
→ Invitation token exposed in API response
→ Reuse/replace token in an existing invitation link
→ Register account using victim email
→ No email ownership verification
→ Victim email becomes associated with attacker-controlled Team
→ Legitimate owner performs password reset
→ Victim logs into the account
→ Victim is already a member of the attacker's Team

Step 1: Attacker-controlled team

The attacker first creates or controls a team within the platform, then uses the normal team invitation functionality to invite an email address. In the PoC the invited address was one the researcher controlled as the victim.

Step 2: Invitation token exposure

When the invitation was sent, the invitation API response contained a sensitive invitation token/code. The application used that token as part of the invitation validation and activation process, which is what made the exposed value useful to an attacker. The write-up does not reproduce the request or the response body.

Step 3: Invitation token reuse

A previously generated invitation link could be used together with another invitation token obtained from the API response. Replacing the token within the existing invitation link manipulated the invitation flow so that the resulting invitation was associated with the target invitation. This is the evidence that the token was not sufficiently bound to the intended recipient and invitation context. The write-up does not show the link format or the exact substitution.

Step 4: Registering an account with the victim's email

The manipulated invitation was then used to proceed through the account registration flow. The application allowed an account to be registered using the victim's email address without requiring the registrant to prove ownership of that address. The address used in the write-up is:

Text
[redacted]

No access to the victim's mailbox was required during account creation. The attacker could therefore create an account with the victim's email address and associate that account with the attacker-controlled team, effectively pre-claiming the victim's email identity inside the application.

Step 5: Victim email becomes unavailable

Once the attacker-created account existed, attempting to register another account with the same email address resulted in the application treating the email as already registered. The legitimate owner could no longer perform a normal fresh registration with their own address. Because the legitimate owner actually controlled the mailbox, however, the password recovery functionality was still available to them.

Step 6: Legitimate owner performs a password reset

The legitimate owner used the normal Forgot Password functionality. After successfully resetting the password, they were able to log into the account associated with their email address. The important part is that the account had already been associated with the attacker-controlled team; the victim had never intentionally accepted an invitation to that team.

Step 7: Victim gains team membership

After logging in, the victim was already associated with the attacker-controlled team. The membership was not merely a display artefact: the victim account could interact with the team normally. During testing the account was able to:

  • Remove users.
  • Cancel invitations.
  • Interact with team functionality.

This demonstrated that the forced membership resulted in actual functional access to the team.

Root cause

The design mistakes, as the write-up frames them, are cumulative:

  • The invitation token is returned in the API response to the invitation request.
  • The token is not bound tightly enough to the invitation it belongs to, so it can be transplanted into another invitation link and still be accepted.
  • Registration does not verify that the registrant owns the email address being registered, so an account can be created for a mailbox the attacker does not control.
  • The invitation flow does not validate ownership of the invited address before establishing membership, and membership is created before the email identity is verified.

The write-up does not include code, so the exact implementation is not shown.

Impact

According to the write-up, an attacker can:

  • Register accounts using arbitrary victim email addresses.
  • Force victim email identities into attacker-controlled teams.
  • Prevent legitimate users from registering normally, because their email is already associated with an account.
  • Cause legitimate users to become associated with organisations they never agreed to join.
  • Break the intended trust relationship between users and organisations.
  • Cause victims to inherit team membership after recovering their account.
  • Allow the victim account to perform team actions according to the permissions associated with the membership.

The primary impact is on account and team integrity. The attacker does not need access to the victim's mailbox; instead they manipulate the application's identity and membership state before the legitimate owner interacts with the account. When the owner later recovers the account through the normal password reset flow, the account already contains the attacker-created organisational relationship.

Fix

Based on the weaknesses it lists, the changes that would close the chain are:

  • Stop returning invitation tokens in API responses, or return them only to a channel the recipient controls.
  • Bind each token to its invitation, recipient and context, and reject a token presented in a different invitation link.
  • Require email ownership verification before an account is usable, and before any team membership is established.
  • Do not create team membership until the invited address has been verified.

Variants to test

  • Token transplant across invitations: take a token from invitation A and place it in the link for invitation B. A positive result is that the flow accepts the transplanted token.
  • Token in the API response: send an invitation and inspect the response body for a token or code. A positive result is a usable activation value returned to the inviter.
  • Registration without mailbox access: register with an address you do not control. A positive result is an account created and usable without any verification step.
  • Membership before verification: complete the invitation flow with an unverified address and check whether team membership exists immediately. A positive result is team membership existing before verification.
  • Pre-claiming the address: after the attacker-created account exists, try a fresh registration with the same address. A positive result is the application reporting the email as already registered.
  • Recovery inheritance: perform a password reset on the pre-claimed address and log in. A positive result is the recovered account already sitting inside the attacker's team with working team actions.

Disclosure

The vulnerability was submitted to the program and reviewed by the security team. The report was determined to be legitimate and rewarded with a $690 bounty.

From the original on medium.com

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. 14 min read.

What happened, in plain words

A security researcher was testing a website that lets people form teams and invite others by email. He found a way to make any email address, including one belonging to someone who had never heard of the site, become a member of a team the attacker controls. The real owner of that email never clicked "accept" on anything. When they later used the ordinary "forgot password" button and got back into the account, they discovered they were already sitting inside a stranger's team.

The trick was not one single bug. It was a chain of small design mistakes that only become dangerous together. The invitation system handed out a secret code too freely, that code was not tied tightly enough to the invitation it belonged to, and the sign-up form never checked that the person typing an email address actually owned it. Each of those on its own looks minor. Stacked together, they let an attacker claim someone else's email address inside the application before the real owner ever showed up.

This article walks through the whole chain in the order the researcher found it, explaining every term from scratch along the way.

Background: what the product does

The target is a platform with a team feature. A team is a group of user accounts that share access to something, and being a member of a team is what gives an account the right to act inside it: see the other members, manage them, and so on. Think of a team like a shared folder in a cloud drive: your account is the key, and membership is the list of people allowed through the door.

To get people into a team, the platform uses invitations. You type an email address, the platform sends that address a message containing a link, and the person who receives it follows the link into a registration flow, the series of screens where a new account is created. If the invited person does not have an account yet, the invitation link is how they end up with one, already attached to the team that invited them.

Two words that come up constantly from here on:

  • An API (Application Programming Interface) is the set of behind-the-scenes addresses a website's own pages talk to. When you click a button, your browser often sends a small request to one of these addresses and gets data back, usually in a machine-readable format such as JSON. Think of the website's visible pages as the counter of a shop, and the API as the back office the counter staff shout orders to. You normally never see the back office, but a curious person with browser developer tools can watch the messages going back and forth.
  • A token is a short string of characters that acts as proof, like a cloakroom ticket. Whoever holds the ticket can collect the coat; the cloakroom does not ask who you are. Invitation links usually contain a token so the platform can tell which invitation is being accepted without asking the visitor to log in first.

The researcher tested the invitation and registration features together, rather than one at a time, and that is how the chain appeared. The write-up lists the individual weaknesses like this:

  • Invitation tokens were exposed in API responses.
  • Invitation tokens were not sufficiently bound to their intended invitation context.
  • Account registration did not require email ownership verification.
  • The invitation flow did not properly validate ownership of the invited email address.
  • Team membership could be established before the email identity was verified.

The end result is that the victim's email identity is pre-claimed inside the application: an account already exists for that address, created by someone else, and it already belongs to a team. When the real owner later recovers the account through the normal password reset, the team membership is waiting for them.

Setup

The write-up does not name the program, the product or any software versions, and it does not describe any special tools. The only concrete setup detail is that the researcher created or controlled a team on the platform and used the ordinary invitation feature to invite an email address. For the proof of concept, the invited address was one the researcher controlled as the victim.

Finding it

The researcher was testing the team invitation and account registration functionality. Two observations drove everything that followed.

  1. When an invitation was sent, the invitation API response contained a sensitive invitation token/code. The application used that token as part of invitation validation and activation. In plain words: the back office, when asked to send an invitation, answered with the cloakroom ticket written on the receipt, and that same ticket is what the invitation link uses to prove the invitation is genuine.
  2. A previously generated invitation link could be used together with another invitation token obtained from an API response. By replacing the token inside the existing invitation link, the invitation flow could be manipulated so the resulting invitation was associated with the target invitation.

The second point is the interesting one. A well-built invitation system ties each token to one specific invitation: this token, for this recipient, for this team. Here the token was not sufficiently bound to the intended recipient and invitation context, so a token from one invitation could be dropped into the link of another and still be accepted. It is like a cloakroom that accepts any ticket for any coat.

From there the researcher checked whether the manipulated invitation could carry the flow all the way through registration, and found that an account could be registered with the victim's email address without proving ownership of that mailbox. That is the third leg of the chain: the sign-up form believed whatever address was typed into it.

Exploitation

The attack chain, as summarised in the write-up:

Text
Attacker-controlled Team
→ Send invitation to victim email
→ Invitation token exposed in API response
→ Reuse/replace token in an existing invitation link
→ Register account using victim email
→ No email ownership verification
→ Victim email becomes associated with attacker-controlled Team
→ Legitimate owner performs password reset
→ Victim logs into the account
→ Victim is already a member of the attacker's Team

Read the arrows as "then". Each line is one action or one consequence, and the chain only works because every link holds. The first four lines are things the attacker does; the last four are what the victim experiences without ever choosing it.

Step 1: Attacker-controlled team

The attacker first creates or controls a team within the platform, then uses the normal team invitation functionality to invite an email address. In the PoC (proof of concept, a demonstration that the attack really works) the invited address was one the researcher controlled as the victim.

Why start here? Because the whole attack is about getting a victim attached to a team the attacker owns. You need a team to attach them to, and you need to see the invitation go out so you can capture what the platform sends back.

Step 2: Invitation token exposure

When the invitation was sent, the invitation API response contained a sensitive invitation token/code. The application used that token as part of the invitation validation and activation process, which is what made the exposed value useful to an attacker.

Why this matters: a token is only secret if it stays with the person it was meant for. Here the token came back in the response to the invitation request, meaning the person who sent the invitation could read it. The write-up does not reproduce the request or the response body, so we do not know the exact field name or format.

Step 3: Invitation token reuse

A previously generated invitation link could be used together with another invitation token obtained from the API response. Replacing the token within the existing invitation link manipulated the invitation flow so that the resulting invitation was associated with the target invitation. This is the evidence that the token was not sufficiently bound to the intended recipient and invitation context.

Why this step exists: the researcher wanted to know whether a token is checked for validity only, or also for belonging to this particular invitation. A previously generated invitation link was used together with another invitation token. The platform accepted the mix, which proves the binding was missing. The write-up does not show the link format or the exact substitution, so there is no URL to copy here.

Step 4: Registering an account with the victim's email

The manipulated invitation was then used to proceed through the account registration flow. The application allowed an account to be registered using the victim's email address without requiring the registrant to prove ownership of that address. The address used in the write-up is:

Text
[redacted]

That single line is just the placeholder email address used in the demonstration. example.com is a domain reserved for examples, so no real person is involved. The point is that the form accepted it with no proof.

No access to the victim's mailbox was required during account creation. The attacker could therefore create an account with the victim's email address and associate that account with the attacker-controlled team, effectively pre-claiming the victim's email identity inside the application.

Why this is the heart of the bug: most websites send a confirmation email with a link or a code before they treat an address as yours. That step is called email ownership verification, and it exists precisely to stop someone signing up with an address they do not control. Without it, the sign-up form is trusting a claim rather than checking it.

Step 5: Victim email becomes unavailable

Once the attacker-created account existed, attempting to register another account with the same email address resulted in the application treating the email as already registered. The legitimate owner could no longer perform a normal fresh registration with their own address. Because the legitimate owner actually controlled the mailbox, however, the password recovery functionality was still available to them.

Why this matters: the attacker has now taken the victim's place in the sign-up queue. The real owner cannot simply create their own account, because the platform says the address is taken. The only door left open to them is the one that requires reading their email: the password reset.

Step 6: Legitimate owner performs a password reset

The legitimate owner used the normal Forgot Password functionality. After successfully resetting the password, they were able to log into the account associated with their email address. The important part is that the account had already been associated with the attacker-controlled team; the victim had never intentionally accepted an invitation to that team.

Why this is the moment the trap closes: the password reset proves the person controls the mailbox, which is exactly the proof the sign-up form never asked for. But by then the account already exists, and it already carries the team membership the attacker arranged. The victim is walking into a room that was furnished before they arrived.

Step 7: Victim gains team membership

After logging in, the victim was already associated with the attacker-controlled team. The membership was not merely a display artefact: the victim account could interact with the team normally. During testing the account was able to:

  • Remove users.
  • Cancel invitations.
  • Interact with team functionality.

This demonstrated that the forced membership resulted in actual functional access to the team.

Why the researcher checked this: a bug that only shows a wrong label on a page is cosmetic. A bug that gives a real account real powers inside someone else's team is a security problem. Removing users and cancelling invitations are actions with consequences, so the membership was genuine.

Root cause

The design mistakes, as the write-up frames them, are cumulative:

  • The invitation token is returned in the API response, so anyone who can trigger or observe an invitation can obtain a valid token.
  • The token is not bound tightly enough to the invitation it belongs to, so it can be transplanted into another invitation link and still be accepted.
  • Registration does not verify that the registrant owns the email address being registered, so an account can be created for a mailbox the attacker does not control.
  • The invitation flow does not validate ownership of the invited address before establishing membership, and membership is created before the email identity is verified.

Likely, the invitation validation checks that the token is valid but not that it matches the specific invitation, recipient and context it was issued for, and the registration step trusts the invitation as sufficient authorisation to attach the new account to the team. The write-up does not include code, so the exact implementation is not shown.

A useful comparison: a bouncer who checks that a ticket is genuine but not whose name is on it, at a venue where you can also print your own tickets. Each gap is survivable alone; together they let anyone in.

Impact

According to the write-up, an attacker can:

  • Register accounts using arbitrary victim email addresses.
  • Force victim email identities into attacker-controlled teams.
  • Prevent legitimate users from registering normally, because their email is already associated with an account.
  • Cause legitimate users to become associated with organisations they never agreed to join.
  • Break the intended trust relationship between users and organisations.
  • Cause victims to inherit team membership after recovering their account.
  • Allow the victim account to perform team actions according to the permissions associated with the membership.

The primary impact is on account and team integrity. Integrity here means the data says what it should say: this account belongs to this person, this team contains these members. The attacker does not need access to the victim's mailbox; instead they manipulate the application's identity and membership state before the legitimate owner interacts with the account. When the owner later recovers the account through the normal password reset flow, the account already contains the attacker-created organisational relationship.

Fix

Based on the weaknesses it lists, the changes that would close the chain are:

  • Stop returning invitation tokens in API responses, or return them only to a channel the recipient controls.
  • Bind each token to its invitation, recipient and context, and reject a token presented in a different invitation link.
  • Require email ownership verification before an account is usable, and before any team membership is established.
  • Do not create team membership until the invited address has been verified.

In everyday terms: keep the cloakroom ticket in the coat owner's pocket, write the owner's name on the ticket, and do not hand over the coat until the person at the counter proves who they are.

Variants to test

If you are learning to test this kind of feature, these are the checks the write-up's findings suggest, each with what a positive result looks like:

  • Token transplant across invitations: take a token from invitation A and place it in the link for invitation B. A positive result is that the flow accepts the transplanted token.
  • Token in the API response: send an invitation and inspect the response body for a token or code. A positive result is a usable activation value returned to the inviter.
  • Registration without mailbox access: register with an address you do not control. A positive result is an account created and usable without any verification step.
  • Membership before verification: complete the invitation flow with an unverified address and check whether team membership exists immediately. A positive result is team membership existing before verification.
  • Pre-claiming the address: after the attacker-created account exists, try a fresh registration with the same address. A positive result is the application reporting the email as already registered.
  • Recovery inheritance: perform a password reset on the pre-claimed address and log in. A positive result is the recovered account already sitting inside the attacker's team with working team actions.

To inspect an API response in a browser, open the developer tools (usually F12), go to the Network tab, perform the action, and click the request that appears. The response body is shown alongside it.

Disclosure

The vulnerability was submitted to the program and reviewed by the security team. The report was determined to be legitimate and rewarded with a $690 bounty.

From the original on medium.com

Glossary

  • API: the set of behind-the-scenes addresses a website's pages use to send and receive data; you normally see it only in browser developer tools.
  • API response: the data an API sends back after a request, often in JSON format.
  • Bounty: a reward paid by a company to a researcher who reports a valid security problem.
  • Developer tools: the built-in panel in a browser (usually opened with F12) that shows requests, responses and page code.
  • Email ownership verification: a step where a site sends a message to an address and asks for a link or code back, proving the person controls that mailbox.
  • Forgot Password / password reset: the feature that lets someone set a new password after receiving a message at their email address; it proves mailbox control.
  • Integrity: the property that data says what it should say and has not been changed by someone who should not have changed it.
  • Invitation: a message sent to an email address offering to join a team, usually containing a link.
  • Invitation context: the specific invitation a token was issued for, including who it was sent to and which team it belongs to.
  • JSON: a plain-text format for structured data, made of names and values in curly braces.
  • Member / membership: an account's place inside a team, which is what grants it the ability to act there.
  • Password recovery: see Forgot Password.
  • PoC (proof of concept): a demonstration that a suspected vulnerability really works.
  • Pre-claim: creating an account for an email address before its real owner does, so the address appears taken.
  • Registration flow: the series of screens where a new account is created.
  • Root cause: the underlying design or coding mistake that makes a vulnerability possible.
  • Team: a group of accounts on the platform that share access and permissions.
  • Token: a short string of characters that acts as proof of something, like a cloakroom ticket; whoever holds it is trusted.
  • Vulnerability: a weakness in software that someone can use to make it behave in a way its owners did not intend.
  • Vulnerability chain: several weaknesses that are minor alone but serious when used one after another.

More by zyadatef2462003

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.