How a Race Condition Broke an Organization’s Member Limit
Published on medium.com
Business logic vulnerabilities aren’t always caused by a flawed validation rule. Sometimes, the rule itself is correct, but the way the application enforces it under concurrent execution makes it possible to bypass it.
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
The target was an organisation's invitation feature. An account was restricted to inviting only one additional member. Under normal, sequential use the application appeared to enforce this limit correctly: the configured member allowance was visible and the invitation flow respected it.
The weakness was not a broken validation rule. The rule was correct; the way the application enforced it when several invitation requests arrived at the same time was not. The report frames this as a business logic issue that only appears under concurrent execution.
Setup
- Role: organisation owner. I logged in with this account and verified the configured member allowance before testing.
- Tool: Burp Suite Repeater, used to capture the invitation request and to send several copies concurrently.
- Precondition: the account was limited to one additional member, and the invitation endpoint accepted a request that identified the invitee.
- Authorisation: the testing was done during an authorised security assessment.
Finding it
The member limit looked correctly enforced in normal use, which is exactly why it was worth probing. A limit that is checked and then applied in two separate steps is a candidate for a Time-of-Check to Time-of-Use (TOCTOU) race condition: if several requests all read the same shared state before any of them updates it, they can all pass the check.

The question I wanted to answer was how the application behaved when multiple invitation requests were processed simultaneously, rather than one after another.
Exploitation
Step 1: Confirm the baseline
I logged in as the organisation owner and verified the configured member allowance. The account was restricted to inviting one additional member, and the application enforced this under normal conditions.
Step 2: Capture the invitation request
I captured an invitation request using Burp Suite Repeater. The request targets the invitation functionality.
Step 3: Prepare concurrent requests
I prepared multiple requests targeting different invitees.
Step 4: Synchronise execution with Single Packet Attack
I used Repeater's Single Packet Attack to synchronise the execution of the prepared requests, so that they would reach the application within the same time window. The goal is to have every request perform its member-limit check before any of them updates the shared state.
Step 5: Observe the result
The application processed multiple invitations despite the account's restriction. To rule out the possibility that this only affected the creation of pending invitations, I accepted the invitations through the invited accounts and then checked the resulting organisation membership.
Multiple invited accounts successfully joined the organisation, exceeding the original member allowance. The restriction was therefore bypassed end to end, not just at the invitation-creation stage.
Root cause
The behaviour is consistent with a TOCTOU race condition, in which multiple concurrent operations interact with shared state before a security-critical restriction is effectively enforced. Conceptually, the workflow looks like this:
[Request A] [Request B]
Check member limit Check member limit
Limit available Limit available
Create invitation Create invitation
If both requests evaluate the same shared state before either operation updates the state in a way that affects the other, both may pass the validation.
The application does not lack a member-limit check. The problem is that enforcement of the constraint does not appear to be atomic under concurrent execution.
Impact
The demonstrated impact was the ability to exceed the organisation's intended member invitation restriction. I verified that multiple invited accounts successfully joined the organisation despite the original allowance, confirming that the restriction could be exceeded through concurrent invitation requests.
Depending on how membership limits are tied to subscription plans, licensing or organisational policies, this type of vulnerability may undermine server-side enforcement of account restrictions. The report does not quantify any further consequence beyond exceeding the member allowance.
Fix
The member-limit validation and the operation that modifies the relevant membership or invitation state should be protected by an atomic enforcement mechanism. Depending on the application's architecture, this could be achieved through:
- database transactions with appropriate locking;
- atomic reservation of member slots;
- other mechanisms that ensure concurrent requests cannot independently pass the same restriction.
Enforcement should also remain consistent across the invitation and acceptance workflows, so that concurrent operations cannot collectively violate the member limit. The report describes the recommended remediation rather than a change that was confirmed deployed.
- Other quota-style limits. Any feature that enforces a per-account maximum (seats, projects, API keys, exports) may use the same check-then-act pattern. A positive result is more resources created than the plan allows, confirmed after the fact rather than only in a pending state.
- Two-stage flows. Where creation and acceptance are separate steps, test concurrency at both. A positive result is that the final accepted state exceeds the limit even if the creation stage looked capped.
- Mixed operations. Send concurrent requests that combine invitation creation with acceptance or removal, to see whether the shared state can be driven into an inconsistent position. A positive result is a membership count above the allowance after the requests settle.
- Different synchronisation techniques. If one method does not align the requests tightly enough, try another that releases them in the same window. A positive result is the same over-limit membership, showing the issue is in the application rather than the tooling.
What happened, in plain words
An organisation is a group account on some web service, a bit like a shared workspace. The owner of that workspace can invite other people to join it. The service had a rule: this particular account was allowed to invite only one extra member. When you clicked through the invitation screen normally, the rule held. The application appeared to enforce this limit correctly under normal conditions.
The researcher found that if several invitation requests were sent at almost exactly the same moment, the service let more than one through. The invited people then accepted, and they really did become members of the organisation, so the account ended up with more members than its allowance. The rule itself was fine. The problem was the timing: the service checked the limit and then acted on it as two separate moments, and several requests arriving together could all pass the check before any of them had used up the one allowed slot.
This kind of flaw is called a race condition. It is a business logic issue, meaning the bug is not in some low-level piece of code but in the way the application's own rules are applied.
Background you need first
A few everyday ideas make the rest of this easy to follow.
- Web application / service: a program running on a company's server that your browser talks to. You see pages and buttons; behind them the server decides what is allowed.
- Request: the message your browser sends to the server when you do something, such as clicking "Invite". It says what you want and carries proof of who you are.
- Response: the server's reply, for example "invitation created" or "you have reached your limit".
- Endpoint: the specific address on the server that handles one kind of action. The invitation endpoint is the one that deals with invitations.
- Session / cookie: after you log in, the server gives your browser a small piece of data (a cookie) that it sends back with every request so the server knows it is still you. Think of it as a wristband at an event: you show it at the door instead of your ID every time.
- Burp Suite: a tool used by security testers that sits between your browser and the server. It can record requests, let you edit them, and send them again. Repeater is one part of Burp: a screen where you hold a single request, change it, and press send as often as you like.
- Race condition: when the result of an action depends on the exact order or timing of events that happen at the same time. A simple comparison: two people both look at the last seat on a bus, both see it free, and both sit down. Each check was correct when it was made; the problem is that the check and the taking of the seat were not one single step.
- Time-of-Check to Time-of-Use (TOCTOU): the formal name for that pattern. There is a moment when the application checks a rule (time of check) and a later moment when it acts on the result (time of use). Anything that changes in between can make the check stale.
- Atomic: done as one indivisible step, so nothing else can slip in halfway. Locking a door and walking through it in one motion, rather than checking the door is unlocked and then walking through it a second later.
- Shared state: information the server keeps that several requests can read and change, such as "how many members does this organisation have right now".
- Business logic vulnerability: a flaw in how the application's own rules are implemented, rather than in generic technical plumbing. The rule reads correctly on paper; the implementation lets you get around it.
Context
The target was an organisation's invitation feature. An account was restricted to inviting only one additional member. Under normal, sequential use, meaning one action after another, the application appeared to enforce this limit correctly: the configured member allowance was visible and the invitation flow respected it.
The weakness was not a broken validation rule. The rule was correct; the way the application enforced it when several invitation requests arrived at the same time was not. The report frames this as a business logic issue that only appears under concurrent execution, that is, when several things happen at once.
Setup
Before testing, the researcher set up a few things:
- Role: organisation owner. This is the account that is allowed to invite people, so it is the account whose limit matters. The researcher logged in with it and checked the configured member allowance first, so there was a known baseline to compare against later.
- Tool: Burp Suite Repeater, used to capture the invitation request and to send several copies of it at once.
- Precondition: the account was limited to one additional member, and the invitation endpoint accepted a request that identified the invitee, meaning the request said who was being invited.
- Authorisation: the testing was done during an authorised security assessment, so the owner of the system had given permission for it.
Finding it
The member limit looked correctly enforced in normal use, which is exactly why it was worth probing. A limit that is checked and then applied in two separate steps is a candidate for a Time-of-Check to Time-of-Use (TOCTOU) race condition: if several requests all read the same shared state before any of them updates it, they can all pass the check.

The question the researcher wanted to answer was how the application behaved when multiple invitation requests were processed simultaneously, rather than one after another.
Exploitation
Step 1: Confirm the baseline
The researcher logged in as the organisation owner and verified the configured member allowance. The account was restricted to inviting one additional member, and the application enforced this under normal conditions. Doing this first matters because you need to know what "correct" looks like before you try to break it. If the limit had already been broken in normal use, the finding would be a different, simpler bug.
Step 2: Capture the invitation request
The researcher captured an invitation request using Burp Suite Repeater. The request targets the invitation functionality. Capturing means recording the exact message the browser sends when you invite someone, so it can be replayed and modified by hand. The report does not include the request itself, so there is no code to show here.
Step 3: Prepare concurrent requests
The researcher prepared multiple requests targeting different invitees.
Step 4: Synchronise execution with Single Packet Attack
The researcher used Repeater's Single Packet Attack to synchronise the execution of the prepared requests, so that they would reach the application within the same time window. The goal is to have every request perform its member-limit check before any of them updates the shared state.
Sending requests "at the same time" from a normal tool is harder than it sounds, because network delays and the tool's own processing spread them out. Single Packet Attack is a Repeater feature used to synchronise the requests so they reach the application within the same time window. The report does not describe how the feature works internally.
Step 5: Observe the result
The application processed multiple invitations despite the account's restriction. To rule out the possibility that this only affected the creation of pending invitations, the researcher accepted the invitations through the invited accounts and then checked the resulting organisation membership.
This extra step is important. A pending invitation is only a stored intention; it does not yet add a member. If the bug had only created extra pending invitations that could never be accepted, the impact would be much smaller. Accepting them and confirming the membership shows the limit was bypassed end to end, not just at the invitation-creation stage.
Multiple invited accounts successfully joined the organisation, exceeding the original member allowance.
Root cause
The behaviour is consistent with a TOCTOU race condition, in which multiple concurrent operations interact with shared state before a security-critical restriction is effectively enforced. Conceptually, the workflow looks like this:
[Request A] [Request B]
Check member limit Check member limit
Limit available Limit available
Create invitation Create invitation
Line by line, in plain words:
[Request A]and[Request B]are two invitation requests arriving at the server at nearly the same moment.Check member limiton both lines: each request asks the server "is there room for another member?".Limit availableon both lines: because neither request has yet changed anything, both get the answer "yes, there is room".Create invitationon both lines: each request then goes ahead and creates its invitation, so two invitations exist where only one was allowed.
If both requests evaluate the same shared state before either operation updates the state in a way that affects the other, both may pass the validation.
The application does not lack a member-limit check. The problem is that enforcement of the constraint does not appear to be atomic under concurrent execution. The check and the state change that should consume a member slot are not tied together, so concurrent requests can each see the limit as available.
Impact
The demonstrated impact was the ability to exceed the organisation's intended member invitation restriction. The researcher verified that multiple invited accounts successfully joined the organisation despite the original allowance, confirming that the restriction could be exceeded through concurrent invitation requests.
Depending on how membership limits are tied to subscription plans, licensing or organisational policies, this type of vulnerability may undermine server-side enforcement of account restrictions. In other words, if a company charges per member, or if a policy says a workspace may hold only a certain number of people, a limit that can be raced past is not really a limit. The report does not quantify any further consequence beyond exceeding the member allowance.
Fix
The member-limit validation and the operation that modifies the relevant membership or invitation state should be protected by an atomic enforcement mechanism. Depending on the application's architecture, this could be achieved through:
- database transactions with appropriate locking;
- atomic reservation of member slots;
- other mechanisms that ensure concurrent requests cannot independently pass the same restriction.
In everyday terms: the check and the change must happen as one step, so that a second request arriving at the same moment either waits its turn or is refused. A database transaction is a way of grouping several changes so they succeed or fail together; locking means one request holds the relevant record while it works, and others wait. Reserving a slot atomically means the act of claiming the one free place is itself a single step, so two requests cannot both claim it.
Enforcement should also remain consistent across the invitation and acceptance workflows, so that concurrent operations cannot collectively violate the member limit. The report describes the recommended remediation rather than a change that was confirmed deployed.
Once you know a check-then-act pattern exists in one place, it is worth looking for it elsewhere. The report lists these directions:
- Other quota-style limits. Any feature that enforces a per-account maximum (seats, projects, API keys, exports) may use the same check-then-act pattern. A positive result is more resources created than the plan allows, confirmed after the fact rather than only in a pending state.
- Two-stage flows. Where creation and acceptance are separate steps, test concurrency at both. A positive result is that the final accepted state exceeds the limit even if the creation stage looked capped.
- Mixed operations. Send concurrent requests that combine invitation creation with acceptance or removal, to see whether the shared state can be driven into an inconsistent position. A positive result is a membership count above the allowance after the requests settle.
- Different synchronisation techniques. If one method does not align the requests tightly enough, try another that releases them in the same window. A positive result is the same over-limit membership, showing the issue is in the application rather than the tooling.
Glossary
- Atomic: done as one indivisible step, so nothing else can happen halfway through.
- Authorised security assessment: testing done with the system owner's permission.
- Baseline: the normal, expected behaviour recorded before testing, used for comparison.
- Burp Suite: a tool that sits between your browser and a server to record, edit and resend requests.
- Business logic vulnerability: a flaw in how an application's own rules are implemented, rather than in generic technical plumbing.
- Concurrent execution: several operations happening at the same time rather than one after another.
- Cookie: a small piece of data your browser stores and sends back so the server recognises your session.
- Database transaction: a group of changes that succeed or fail together as a unit.
- Endpoint: the specific address on a server that handles one kind of action.
- Invitee: the person being invited.
- Locking: making one request hold a record while it works, so others must wait.
- Member allowance: the maximum number of members an account is permitted to have.
- Pending invitation: an invitation that has been created but not yet accepted, so it has not added a member.
- Race condition: a flaw where the result depends on the exact timing or order of simultaneous events.
- Repeater: the part of Burp Suite where you hold a single request, edit it and send it again.
- Request: the message your browser sends to a server asking it to do something.
- Response: the server's reply to a request.
- Server-side enforcement: the server itself applying a rule, rather than relying on the browser to behave.
- Session: the period during which the server recognises you as logged in.
- Shared state: information the server keeps that several requests can read and change.
- Single Packet Attack: a Repeater feature used here to release several prepared requests together so they reach the application in the same time window.
- Time-of-Check to Time-of-Use (TOCTOU): a flaw where a rule is checked at one moment and acted on at a later moment, so something can change in between.
- Validation: the part of an application that checks whether an action is allowed.