Race Conditions Exist When Accepting Invitations
An invitation token could be accepted more than once because the accept action was not atomic, so two users clicking accept at nearly the same moment both got authenticated on a single invite. An attacker with an invite link could therefore join an organisation twice or let an extra person in, and the author suggests this may combine with a token timing issue to confuse an administrator.
- Triaged in 12 hours
- Fixed in 2 days
- Disclosed after 57 days
Hi All, Further to my last two comments on report #118312 and realizing that tokens are being stored in the DB, I realized there is probably a race condition vulnerability which allows invitation tokens to be consumed at least twice depending on the server/database response time.
I tested it tonight and was able to authenticate two accounts on one invite for my test company, test22 simply by clicking the accept button quickly in two separate browsers with two separately logged in users. I've attached screenshots of the two confirmation emails back to the administrator -- they both show the same receipt time... I know this doesn't prove the race condition so if required, I can try and duplicate it in a video if required. It only took two attempts. I was hoping you might be able to see something in the server logs - it happened at 7:58pm EST
I know this isn't necessarily a huge vulnerability in and of itself but I was thinking, a) an invitation should only be able to be accepted once and b) if I'm right with #118312 and the invitation tokens are vulnerable to a timing attack (which looks more likely given the race condition here), an attacker could accept one multiple times and the confusion for the administrator could give the attacker more time to browse reports...
Thoughts?
Attachments


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 accept-invitation handler checks the token and then marks it consumed in separate, non-atomic steps, so concurrent requests both pass the check before either write lands.
Impact
One invitation could be redeemed by more than one account, and the author suggests this may be combined with a token timing weakness to confuse an administrator, though the race itself is described as not necessarily a huge vulnerability.
What the attacker needed
A valid invitation link; two accounts or browsers; clicking accept at nearly the same time
The fix
An invitation should only be able to be accepted once.
How it was found
- Create a test company and send an invitation.
- Log in as two separate users in two separate browsers.
- Use the invitation in both browsers.
- Click accept in both browsers as quickly as possible.
- Observe that both accounts are authenticated on the single invite.
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.
An invitation link contains a secret token meant to work once. Here a race condition let two users clicking accept at nearly the same moment both be authenticated on one invite.
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.