Race Condition leads to undeletable group member
A race condition in the group join endpoint allowed a user to be added to a group twice, which made them impossible to remove by either the user or the group leader. An attacker with a valid invitation link could gain permanent membership of a group.
- Paid in 2 months
- Disclosed after 9 months
Summary by the researcher
It was a small race condition bug in which a group user couldn't be removed from the group even by the admin after they join. This was kinda a fun bug(though low severity) to find when I was learning about race conditions way back in June last year. I thought about trying this after seeing another disclosed report on RC on ctf.hacker101.com itself
The report
Hi,
Summary: There exists a Race Condition in which the user can add themselves twice to a group which will make them unremovable from group. They themselves cannot remove themselves from the group as well as the group leader cannot remove that user from the group. Ofcourse this is a low severity as that malicious user first needs to have a valid invitation link, but nevertheless this leads to permanent membeship of group so this needs to be fixed in my opinion.
Steps To Reproduce
We need two accounts to reproduce this.
-
First account will be leader account
-
Second account will be a normal account.
-
Create a group from the first account and create an invitation link.
-
Join using the invitation link on the second account and intercept the request:
POST /group/post_join HTTP/1.1
Host: ctf.hacker101.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ctf.hacker101.com/group/join?invite=bb5c42ab578b12c63e5d868b3e03816c8c45597262aaf095ca2be19116b8fd0a
Content-Type: application/x-www-form-urlencoded
Content-Length: 109
Connection: close
Cookie: COOKIES
Upgrade-Insecure-Requests: 1
csrf=391aecf0c3125e90c437d04c18204ab6&invite=bb5c42ab578b12c63e5d868b3e03816c8c45597262aaf095ca2be19116b8fd0a
Repeat the above requests in parallel. I did it for 5 parallel requests and I was able to add myself 2 times to that group:

- Now try deleting the user from first account(group leader). No matter how much you try, you won't be able to delete it.
This would lead to a state where the group leader will have to delete the group and create a new group if he wants the malicious user to get removed.
Thanks, Yash
Impact
Irremovable/permanent member of the group. Even the group leader cannot remove that user.
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 did not check for an existing membership atomically, so parallel requests created duplicate membership records that the removal logic could not handle.
Impact
A user with a valid invitation link could become a permanent, irremovable member of a group, forcing the leader to delete and recreate the group.
What the attacker needed
A valid invitation link; two accounts; ability to send parallel requests
How it was found
- Create a group from the first account and generate an invitation link.
- Join using the invitation link on the second account and intercept the join request.
- Send the join request several times in parallel.
- Try to remove the second user from the group leader account; removal fails.
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.
Sending the join request several times at once added the user twice, and after that neither the user nor the group leader could remove them.
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.