How i Almost got 2K$ through a Race condition
A race condition in a class role management feature allowed an attacker to become an admin of a class by sending a join request and a role change request in the same packet. The attack was inconsistent, succeeding in only 4 out of 10 attempts, and was closed as low severity.
Published on medium.com
Today i will discuss a race condition finding that lead to gaining organization takeover unfortunately Didn’t get accepted and you will find out why
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 eLearning website where teachers can create classes, add students and create tests for them. The researcher focused on the user role management functionality inside a class.
Each class has six levels, expressed as a numeric user_id on the membership:
| Value | Meaning |
|---|---|
| 0 | The user asked to join the class and is pending the admin's approval |
| 1 | The user is a normal user in the class |
| 3 | The user is an admin user in the class |
| -1 | The user is rejected from joining the class |
| -2 | The user is removed from the group (can still be restored by an admin) |
| -3 | The user is permanently removed and can only join again by invitation or by asking to join |
A user can join a class either by requesting to join or by an invitation.
Setup
The researcher spent one to two weeks on the program. The work was done in Burp Suite's Repeater, using request grouping and the single packet attack to line up two requests. No specific versions, accounts or configuration details are given beyond the roles above: an attacker account, a class the attacker controls, and a victim class the attacker wants to get into.
Finding it
Once the join feature was understood, the researcher tried numerous attack scenarios, including access controls, privilege escalations and logic bugs. None of them worked and all of them led to the same message.

The site was, in the researcher's words, pretty secure. After coming out empty handed, the researcher went back to James Kettle's talk smashing the state machine, on a second rewatch, where race conditions are covered in depth. The idea that stuck was the multi-endpoint race condition, and the goal became to apply it to this target.
Two facts about the role model drove the idea:
- When the user requests to join the class or gets invited into the class, their
user_idis set to 0. - The
user_idhas to be set to 3 to perform admin actions, such as adding and removing users in the class.
When an admin accepts a user or changes a user's role, the request looks like this.

The reasoning was that when requesting to join the class (setting the id to 0), there has to be a slight race window where the attacker is connected to the class but the user_id is not yet set. If that window exists, admin actions could be performed inside it.

The illustration above explains the scenario.
Exploitation
Step 1: Prepare the two requests
Two requests were placed in a single group in Repeater:
- The request to join the victim class.
- The request that makes the attacker an admin in that class. This was produced by performing the same admin action in a class the attacker controls, then changing the class id to the victim's class id.

Escalating my user to admin

Joining the class request
Step 2: Send both in one packet
Both requests were sent in the same packet, a single packet attack. The result was that the attacker became an admin user in the victim class.

Root cause
The report describes the mechanism at the level of the race window: between the moment a user is connected to a class and the moment their user_id is written, the membership exists without the intended role value, and the admin action request sent in the same packet is evaluated in that window. The report does not show the server-side code, so the exact ordering of the checks and the write is not documented here; the behaviour is consistent with a non-atomic check-then-set on the membership record.
Impact
The researcher describes the finding as organisation takeover. In practice, an attacker who reaches the window becomes an admin user in a class they were only asking to join, and can then perform admin actions such as adding and removing users in that class.
The finding was not accepted as a paid issue. It was closed as low severity, and the program does not reward bounties on that severity. Two limits explain the low rating:
- The result was inconsistent: out of 10 classes tried, only 4 were successful.
- Once the attacker tried the attack on one class, they could not try it again, because their
user_idwas already set to 0 in that class.
The researcher also found 6 findings in the Android application of the same target.
Fix
The report does not describe any fix applied by the program. Based on the mechanism above, the membership creation and the role check should be made atomic, so that a membership is never visible to the authorisation logic before its user_id is set, and the admin action should be authorised against the committed role value rather than a partially created record.
Variants to test
- Multi-endpoint race on join and role change: group the join request and an admin action taken from a class you control, rewrite the class id to the victim's, and send both in one packet. A positive result is the admin action succeeding in the victim class.
- Other state transitions with a pending value: look for features with a pending or unset state (invitations, approvals, transfers) and pair the transition request with an action that requires the final state. A positive result is the privileged action being accepted while the state is still pending.
- Repeatability check: run the pair against several distinct classes and count successes. A consistent success rate above chance indicates a real window rather than noise.
- Single attempt per object: note whether a failed attempt consumes the object (as the
user_idbeing set to 0 did here), and plan attempts across separate objects.
Closing note
The main takeaway the researcher draws is to spend more time on the application: the more time spent fiddling with functions, the better the application is understood and the more creative the exploitation ideas become.

What happened, in plain words
A security researcher spent one to two weeks testing an online learning website, the kind where teachers create classes, add students and set tests. The site had a feature for managing who is what inside a class: who is just a member, who is an admin, who is waiting to be let in. The researcher tried many ordinary attacks against that feature and none of them worked. Then he remembered a technique from a conference talk about race conditions, a class of bug where two actions happen so close together that the program gets confused about the order. He used it to make himself an admin in a class he had only asked to join. The trick worked, but only sometimes: out of 10 classes he tried, 4 succeeded. The company closed it as low severity and paid nothing, because the program does not reward that severity level. He also found 6 issues in the same company's Android app.
This article walks through the whole story from zero. You only need to know how to use a browser. Every technical word is explained the first time it appears, and there is a glossary at the end.
The target and the feature
The target was an eLearning website. Teachers can create classes, add students to them and create tests for those students. The researcher focused on one part: user role management inside a class, meaning the feature that decides what each person is allowed to do in that class.
Each class has six levels. The level is stored as a number called user_id on the membership record, which is the database row that says "this person belongs to this class".
| Value | Meaning |
|---|---|
| 0 | The user asked to join the class and is pending the admin's approval |
| 1 | The user is a normal user in the class |
| 3 | The user is an admin user in the class |
| -1 | The user is rejected from joining the class |
| -2 | The user is removed from the group (can still be restored by an admin) |
| -3 | The user is permanently removed and can only join again by invitation or by asking to join |
A user can join a class in two ways: by requesting to join, or by being invited.
A quick word on the vocabulary used from here on:
- A database is where a website keeps its data, like a very large, very organised spreadsheet. Each row about a person in a class is a record.
- An API (Application Programming Interface) is the set of addresses and rules a website's own pages use to talk to its server. When you click a button, your browser sends a request to one of these addresses and the server answers. Tools let a tester send those requests by hand, which is what happens in this story.
- A request is a message your browser sends to a server, for example "please add me to class 42". A response is the server's answer.
- A cookie or token is a small piece of data your browser stores and sends back with every request so the server knows who you are, like a wristband at an event that proves you paid to get in.
- Burp Suite is a tool used by testers to watch, edit and resend these requests. Repeater is one of its windows where you can change a request and send it again as many times as you like.
Setting up
The researcher spent one to two weeks on this program. The work was done in Burp Suite's Repeater, using request grouping and the single packet attack to line up two requests. Request grouping means putting several requests side by side in one tab so they can be sent together. The single packet attack means sending them so close together that the server receives them almost at the same instant. No specific versions, accounts or configuration details are given beyond the roles above: an attacker account, a class the attacker controls, and a victim class the attacker wants to get into.
Finding it
Once the join feature was understood, the researcher tried numerous attack scenarios, including access controls, privilege escalations and logic bugs. In plain terms:
- Access control bugs are cases where the site lets you do something you should not be allowed to do, for example opening someone else's private page by changing a number in the address.
- Privilege escalation means getting a higher role than you were given, for example turning a normal member into an admin.
- Logic bugs are flaws in the site's own rules, where the steps of a feature can be done in an unexpected order or with unexpected values.
None of them worked and all of them led to the same message.

The image sits where the report says all of those attempts led to the same message. The site was, in the researcher's words, pretty secure.
After coming out empty handed, the researcher went back to James Kettle's talk smashing the state machine, on a second rewatch. That talk covers race conditions in depth. A race condition is a bug where the result depends on the exact timing of two actions that happen at nearly the same moment. A simple everyday comparison: two people reach for the last seat on a bus at the same instant, and the booking system, checking "is this seat free?" for both before either has actually sat down, sells it twice. The idea that stuck from the talk was the multi-endpoint race condition: instead of sending the same request many times, you send two different requests at the same moment, each hitting a different part of the site, so that one slips through while the other is still being processed.
Two facts about the role model drove the idea:
- When the user requests to join the class or gets invited into the class, their
user_idis set to 0. - The
user_idhas to be set to 3 to perform admin actions, such as adding and removing users in the class.
When an admin accepts a user or changes a user's role, the request looks like this.

The image sits where the report shows what the request looks like when an admin accepts a user or changes a user's role.
The reasoning was that when requesting to join the class (setting the id to 0), there has to be a slight race window where the attacker is connected to the class but the user_id is not yet set. If that window exists, admin actions could be performed inside it. Think of a new employee whose badge is printed but not yet activated: for a moment the door system knows the person exists but has not decided what they are allowed to open. If you can walk through the door in that moment, the check never happens.

The illustration above explains the scenario.
Exploitation
Step 1: Prepare the two requests
Two requests were placed in a single group in Repeater:
- The request to join the victim class.
- The request that makes the attacker an admin in that class. This was produced by performing the same admin action in a class the attacker controls, then changing the class id to the victim's class id.
The second point deserves a plain explanation. The attacker cannot simply ask the victim's class to make them an admin, because the site would refuse. So instead the attacker creates their own class, where they are already the admin, performs the "make this person an admin" action there, and captures the resulting request. That request is legitimate in the attacker's own class. The attacker then edits one value in it, the class id, replacing their own class with the victim's class. The request now looks like a normal admin action, but it is aimed at a class where the attacker has no rights. On its own it would be rejected. The plan is to send it at the exact moment the join request is still being processed.

Escalating my user to admin

Joining the class request
The two images are captioned "Escalating my user to admin" and "Joining the class request".
Step 2: Send both in one packet
Both requests were sent in the same packet, a single packet attack. The result was that the attacker became an admin user in the victim class.

The image sits after the report's account of sending both requests in one packet and becoming an admin in that class.
Root cause
The report describes the mechanism at the level of the race window: between the moment a user is connected to a class and the moment their user_id is written, the membership exists without the intended role value, and the admin action request sent in the same packet is evaluated in that window. The report does not show the server-side code, so the exact ordering of the checks and the write is not documented here; the behaviour is consistent with a non-atomic check-then-set on the membership record.
In plain words: the server does two things when you ask to join. First it creates the membership, then it fills in the role number. Those two steps are not glued together, which is what atomic means: all or nothing, with no moment in between where someone else can look. During that gap, the membership exists but the role is not yet filled in, and the admin action arrives in that gap. The report does not include the server code, so the exact order of the checks is not shown.
Impact
The researcher describes the finding as organisation takeover. In practice, an attacker who reaches the window becomes an admin user in a class they were only asking to join, and can then perform admin actions such as adding and removing users in that class.
The finding was not accepted as a paid issue. It was closed as low severity, and the program does not reward bounties on that severity. Two limits explain the low rating:
- The result was inconsistent: out of 10 classes tried, only 4 were successful.
- Once the attacker tried the attack on one class, they could not try it again, because their
user_idwas already set to 0 in that class.
The second limit is easy to miss. A race condition is a timing gamble, so you often need several attempts. Here, the first attempt used up the target: after it, the attacker was already a pending member of that class, so the join step could not be repeated there. Each class gave one shot.
The researcher also found 6 findings in the Android application of the same target.
Fix
The report does not describe any fix applied by the program. Based on the mechanism above, the membership creation and the role check should be made atomic, so that a membership is never visible to the authorisation logic before its user_id is set, and the admin action should be authorised against the committed role value rather than a partially created record.
In everyday terms: create the membership and set its role in one indivisible step, and make the permission check read only finished records. Then there is no gap for a second request to slip into.
Variants to test
- Multi-endpoint race on join and role change: group the join request and an admin action taken from a class you control, rewrite the class id to the victim's, and send both in one packet. A positive result is the admin action succeeding in the victim class.
- Other state transitions with a pending value: look for features with a pending or unset state (invitations, approvals, transfers) and pair the transition request with an action that requires the final state. A positive result is the privileged action being accepted while the state is still pending.
- Repeatability check: run the pair against several distinct classes and count successes. A consistent success rate above chance indicates a real window rather than noise.
- Single attempt per object: note whether a failed attempt consumes the object (as the
user_idbeing set to 0 did here), and plan attempts across separate objects.
Closing note
The main takeaway the researcher draws is to spend more time on the application: the more time spent fiddling with functions, the better the application is understood and the more creative the exploitation ideas become.

Glossary
- Access control: the rules that decide who may do what; an access control bug lets someone do something they should not be allowed to do.
- Admin: a user with extra rights in a class, such as adding and removing users.
- API: the set of addresses and rules a website's pages use to talk to its server; testers can send these requests by hand.
- Atomic: done as one indivisible step, all or nothing, with no moment in between where another action can see a half-finished result.
- Authorisation: the check that decides whether a given user is allowed to perform a given action.
- Bounty: a reward a company pays a researcher for reporting a valid security issue.
- Burp Suite: a tool for watching, editing and resending web requests; Repeater is its window for resending requests by hand.
- Class id: the number that identifies a particular class on the site.
- Cookie / token: a small piece of data the browser stores and sends with each request so the server knows who you are.
- Database: where a website stores its data, organised in records (rows).
- Logic bug: a flaw in the site's own rules, where a feature can be used in an unexpected order or with unexpected values.
- Membership record: the database row that says a particular user belongs to a particular class, including their role value.
- Multi-endpoint race condition: sending two different requests at almost the same instant, each hitting a different part of the site, so one slips through while the other is still being processed.
- Non-atomic check-then-set: a sequence where the program first checks a condition and then sets a value as two separate steps, leaving a gap between them.
- Privilege escalation: gaining a higher role than you were given, for example turning a normal member into an admin.
- Race condition: a bug where the outcome depends on the exact timing of two actions happening at nearly the same moment.
- Race window: the short interval during which a half-finished state exists and can be exploited.
- Request / response: a message the browser sends to a server, and the server's answer.
- Role: what a user is allowed to do in a class, stored here as a number.
- Severity: how serious a security issue is rated to be; low severity issues are often not rewarded.
- Single packet attack: sending several requests so close together that the server receives them almost simultaneously.
- State machine: the set of states a feature moves through (for example pending, accepted, removed) and the allowed transitions between them.
user_id: in this report, the numeric role value stored on a class membership (0 pending, 1 normal user, 3 admin, and the negative values for rejected and removed).- Victim class: the class the attacker wants to get into but does not control.