Race condition in joining CTF group
A race condition in the CTF group join endpoint allows a user to join the same group multiple times by sending concurrent requests. This causes the user to appear multiple times in the member list and affects group statistics.
- Triaged in 15 days
- Fixed in 8 months
- Paid in 15 days
- Disclosed after 9 months
Summary:
A race condition in https://ctf.hacker101.com/group/join allows a user to join the same CTF group multiple times.
The user will show up in the group member list multiple times, and affect the group statistics.
Description:
Interestingly a race condition in this feature was reported in #604534, but it seems like the implementation has changed slightly, allowing the same issue to occur.
Steps To Reproduce
-
As the team leader, generate a shared invitation link. For this example the link was
https://ctf.hacker101.com/group/join?invite=fdb4ba75da6e8da41650369d24e3866f90384550f952474df194db8077bda8b0. -
Use Burp Suite to intercept this request and configure Turbo Intruder as follows:
# Find more example scripts at https://github.com/PortSwigger/turbo-intruder/blob/master/resources/examples/default.py
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=100,
requestsPerConnection=100,
pipeline=True
)
# the 'gate' argument blocks the final byte of each request until openGate is invoked
for i in range(30):
engine.queue(target.req, gate='race1')
# wait until every 'race1' tagged request is ready
# then send the final byte of each request
# (this method is non-blocking, just like queue)
engine.openGate('race1')
engine.complete(timeout=60)
def handleResponse(req, interesting):
table.add(req)

- Start the attack, and observe multiple requests succeeding with status code 200.

We can verify from the invited user's screen that we have joined the same group multiple times.

The user will also show up in the group multiple times from the group leader's screen.

Impact
Race condition allows a user to join the same group multiple times. This is more of a low-impact bug, but one that should be fixed nonetheless.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the join endpoint checks membership and inserts the new member without an atomic operation or lock, so concurrent requests can all pass the check before any insert completes.
Impact
A user can join the same group multiple times, which is a low-impact bug that affects group statistics and member lists.
What the attacker needed
A valid invitation link; ability to send concurrent requests
The fix
The join operation should be made atomic, for example with a unique constraint or lock, so only one join succeeds.
How it was found
- As the team leader, generate a shared invitation link.
- Intercept the join request with Burp Suite and configure Turbo Intruder to send many requests concurrently.
- Start the attack and observe multiple requests succeeding with status code 200.
- Verify from the invited user's screen that the same group was joined multiple times.
- Verify from the group leader's screen that the user appears multiple times in the member list.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A race condition happens when a website checks something and then acts on it, but if two requests arrive at almost the same moment, both can pass the check before either one updates the record. Here, the site probably checks if you are already a member and then adds you, but sending many requests at once lets several additions happen before the first one is saved. This lets one person appear many times in a group.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.