Skip to content
Race condition Write-up Intermediate

2 Race Condition let me get money free on a 10 Million users Company on a Hackerone program

The booking platform's refund and gift-card redemption flows checked eligibility and then updated state in separate, non-atomic steps, so concurrent requests could each pass the check. An attacker could obtain multiple refunds for one booking or reuse a single-use gift card across several carts.

Sebastian Vargas Follow

Published on medium.com

Bug Bounty Writeup

Sebastian Vargas, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

The target was a booking platform for hotels and activities, described in the report as a well-known company with more than 10 million users. The researcher found two race condition vulnerabilities in a vulnerability disclosure program run on HackerOne. The company name and sensitive implementation details are deliberately omitted from the write-up.

Both bugs sit in money-handling features:

  • Refunds. A user can cancel a booking and receive a full refund, either back to the original payment method or as account credit.
  • Gift cards. A gift card can be used to pay for a booking, fully or partially, and is intended to be usable only once.

In normal sequential use both features behave correctly. The problem appears when several requests for the same operation arrive at the same time.

Setup

The researcher used a test account and Burp Suite, with request interception and Repeater, including its parallel request group feature. For the refund proof of concept the refund was taken as account credit; the report states the same behaviour was reproducible with the original payment method in the authorised testing environment.

Before the refund test the test account held a credit balance of approximately 500 units of currency. For the gift card test the researcher bought gift cards through the application itself and used two separate shopping carts.

Finding it

The researcher started by walking the main functionality: logging in, browsing the booking platform, adding activities to a cart, checking out and paying.

From the original on medium.com

After payment the application sent a confirmation email and added the booking to the user's "Trips" section.

From the original on medium.com

The researcher tested the refund flow first. The researcher intercepted the cancellation request to see what it contained.

From the original on medium.com

After the first race condition was confirmed, the researcher decided to examine other areas where a similar concurrency issue might exist.

Exploitation

Step 1: create a refundable booking

  1. Log in to the application.
  2. Add several activities to the shopping cart and proceed to checkout.
  3. Enter payment details and complete the reservation.
  4. The application sends a confirmation email and adds the booking to the "Trips" section.

Step 2: capture the refund request

  1. Open the booking details and select Cancel booking.
  2. Enable request interception in Burp Suite before confirming.
  3. Click Confirm cancellation and capture the refund request.
  4. Send the request to Burp Suite Repeater.
From the original on medium.com

The captured request is the one the application uses to process the refund. The report does not reproduce its raw contents, so the exact endpoint, parameters and headers are not available here.

Step 3: build a parallel request group

Duplicate the captured refund request several times and place the copies into a parallel request group in Repeater.

From the original on medium.com

Step 4: record the starting balance

Before sending anything, check the account credit balance. It was approximately 500 units of currency.

From the original on medium.com

Step 5: fire the requests simultaneously

Send the group using Burp Suite's parallel request functionality.

From the original on medium.com

Step 6: observe the result

Most of the requests returned an HTTP 200 OK response. Back in the application, the same booking had been refunded multiple times.

From the original on medium.com

In the authorised test environment this produced more than ten times the original refund amount.

Step 7: establish normal gift card behaviour

Before attacking the gift card flow, the researcher confirmed how it behaves sequentially.

  1. Purchase a gift card through the application.
  2. Open a shopping cart and apply the gift card.
From the original on medium.com

Under normal conditions the gift card value was deducted from the booking total, as expected.

From the original on medium.com
  1. Create a second account and try to apply the same gift card to a new reservation. The application correctly rejected the request and indicated the gift card had already been used.
From the original on medium.com

This confirms the single-use restriction works when requests arrive one after another.

Step 8: race two carts against one gift card

  1. Purchase another gift card for testing and create two separate shopping carts.
  2. Intercept both requests that apply the gift card, send them to Repeater and create a parallel request group containing both.
From the original on medium.com
  1. Send the requests simultaneously.
From the original on medium.com
  1. Both requests were accepted, and the gift card discount was applied to both shopping carts.
From the original on medium.com
  1. Returning to the application confirmed the same gift card had been used more than once.
From the original on medium.com

Root cause

Both bugs are time-of-check-to-time-of-use conditions where the check and the state change are not atomic.

For refunds, the sequence was likely:

  1. The server checked whether the booking was still eligible for cancellation.
  2. Several requests passed that check almost simultaneously.
  3. Each request issued a refund.
  4. The booking was marked as cancelled only after multiple refund operations had already been processed.

For gift cards, the validation and the redemption were separate operations without sufficient concurrency protection:

  1. Request A checked whether the gift card was unused.
  2. Request B checked whether the gift card was unused.
  3. Both requests received a positive result.
  4. Both requests applied the discount.
  5. The gift card status was updated afterwards.

In both cases the application did not enforce an atomic state transition between the check and the update, so concurrent requests were all processed before the state changed. The refund operation should have been executed atomically and protected against duplicate processing.

Impact

The report lists the following consequences:

  • Unauthorised duplication of refunds.
  • Reuse of a single gift card across multiple shopping carts.
  • Direct loss of company funds or credit.
  • Incorrect financial records and reconciliation issues.
  • Potential abuse at scale through automated concurrent requests.
  • Increased support, chargeback and fraud-investigation costs.

The refund issue is described as particularly serious because it could affect both internal account credit and the original payment method.

Fix

The report does not describe a specific remediation that was applied. It states that the refund operation should be executed atomically and protected against duplicate processing.

Variants to test

  • Cancellation and refund endpoints on any booking, ticketing or subscription product. Send the same cancellation request many times in parallel and check whether the balance or the payment provider shows more than one refund for the same booking.
  • Single-use coupons and gift cards. Apply one code to two carts or two accounts in parallel. A positive result is both requests returning success and both carts showing the discount.
  • Referral and signup bonuses. Submit the same referral or bonus claim concurrently and look for the credit being granted more than once.
  • Withdrawal and transfer endpoints. Race a withdrawal against itself and check whether the balance is debited once while the payout is issued several times.
  • Inventory and seat reservation. Race two purchases of the last unit and check whether both succeed.
  • Rate-limited or quota-limited actions. Race requests against a limit and check whether more than the allowed number succeed.

In each case, record the starting state, send the requests in a single parallel group, and compare the resulting state and any downstream records (emails, ledger entries, provider dashboards) against what a single request should have produced.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found two bugs in a large booking website, one used by more than 10 million people. The site lets you book hotels and activities, pay for them, cancel them, and pay with gift cards. Both bugs are the same kind of mistake, called a race condition. A race condition happens when a program does two things in the wrong order because two actions arrive at almost the same moment. Think of two people reaching for the last seat on a train at the same instant: both see it as free, both sit down, and now there is a problem. Here, the website checked something ("is this booking still cancellable?", "is this gift card unused?") and then changed it, but if many identical requests arrived together, they all passed the check before any of them changed the state.

The first bug let the researcher cancel the same booking many times and get the refund many times over. The second bug let the same gift card be used on two shopping carts at once, even though a gift card is supposed to work only once.

Both were reported through the company's vulnerability disclosure programme on HackerOne. That programme was a VDP, not a paid bug bounty, so no money was paid for the reports. The company name and the technical details of how the site is built are deliberately left out.

To follow along you only need to understand a few ideas:

  • A web request is the message your browser sends to a website when you click something, for example "cancel this booking". The website sends back a response, usually with a status code such as 200 OK meaning "done".
  • An API is the part of a website that accepts these requests and does the work behind the scenes. You can think of it as the kitchen of a restaurant: you (the browser) order from the menu, the kitchen (the API) prepares the food.
  • Burp Suite is a tool that sits between your browser and the website. It can pause a request before it is sent, let you look at it, change it, and send it again. It is like a postal worker who lets you open a letter, read it, copy it, and post several copies at once.
  • Repeater is a part of Burp Suite where you can hold a request and send it again and again.
  • A parallel request group is a feature of Repeater that sends several requests at the same instant, rather than one after another. This is the key to finding race conditions.
  • Account credit is money the site keeps for you in your account, which you can spend on future bookings.

The target

The target was a booking platform for hotels and activities, described as a well-known company with more than 10 million users. The researcher found two race condition vulnerabilities in a vulnerability disclosure programme run on HackerOne. The company name and sensitive implementation details are deliberately omitted.

Both bugs sit in money-handling features:

  • Refunds. A user can cancel a booking and receive a full refund, either back to the original payment method or as account credit.
  • Gift cards. A gift card can be used to pay for a booking, fully or partially, and is intended to be usable only once.

In normal use, one request after another, both features behave correctly. The problem appears when several requests for the same operation arrive at the same time.

Setup

The researcher used a test account and Burp Suite, with request interception and Repeater, including its parallel request group feature. For the refund proof of concept the refund was taken as account credit; the report states the same behaviour was reproducible with the original payment method in the authorised testing environment.

Before the refund test the test account held a credit balance of approximately 500 units of currency. For the gift card test the researcher bought gift cards through the application itself and used two separate shopping carts.

Finding it

The researcher started by walking the main functionality: logging in, browsing the booking platform, adding activities to a cart, checking out and paying.

From the original on medium.com

After payment the application sent a confirmation email and added the booking to the user's "Trips" section.

From the original on medium.com

The researcher tested the refund flow first. The researcher intercepted the cancellation request to see what it contained.

From the original on medium.com

After the first race condition was confirmed, the researcher decided to examine other areas where a similar concurrency issue might exist.

Exploitation

Step 1: create a refundable booking

  1. Log in to the application.
  2. Add several activities to the shopping cart and proceed to checkout.
  3. Enter payment details and complete the reservation.
  4. The application sends a confirmation email and adds the booking to the "Trips" section.

Why this step: you cannot test a refund without something to refund. A real booking gives you a real refund request to work with.

Step 2: capture the refund request

  1. Open the booking details and select Cancel booking.
  2. Enable request interception in Burp Suite before confirming.
  3. Click Confirm cancellation and capture the refund request.
  4. Send the request to Burp Suite Repeater.
From the original on medium.com

The captured request is the one the application uses to process the refund. The report does not reproduce its raw contents, so the exact endpoint, parameters and headers are not available here.

Why this step: the request is the exact message that tells the server "give this person their money back". Once you hold a copy, you can send it as many times as you like, and you can send several copies at the same moment.

Step 3: build a parallel request group

Duplicate the captured refund request several times and place the copies into a parallel request group in Repeater.

From the original on medium.com

Why this step: sending copies one after another would not trigger the bug, because the first one would mark the booking as cancelled and the rest would be rejected. Sending them together is what makes several requests pass the check before any of them changes the state.

Step 4: record the starting balance

Before sending anything, check the account credit balance. It was approximately 500 units of currency.

From the original on medium.com

Why this step: you need a before and after picture. If the balance goes up by more than one refund, you have proof.

Step 5: fire the requests simultaneously

Send the group using Burp Suite's parallel request functionality.

From the original on medium.com

Step 6: observe the result

Most of the requests returned an HTTP 200 OK response. Back in the application, the same booking had been refunded multiple times.

From the original on medium.com

In the authorised test environment this produced more than ten times the original refund amount.

Why this matters: 200 OK is the server saying "done". If most of the copies got that answer, the server processed most of them as real refunds.

Step 7: establish normal gift card behaviour

Before attacking the gift card flow, the researcher confirmed how it behaves sequentially.

  1. Purchase a gift card through the application.
  2. Open a shopping cart and apply the gift card.
From the original on medium.com

Under normal conditions the gift card value was deducted from the booking total, as expected.

From the original on medium.com
  1. Create a second account and try to apply the same gift card to a new reservation. The application correctly rejected the request and indicated the gift card had already been used.
From the original on medium.com

This confirms the single-use restriction works when requests arrive one after another.

Why this step: before you claim a bug, you must show what correct behaviour looks like. If the site already allowed reuse in normal use, there would be no bug to report.

Step 8: race two carts against one gift card

  1. Purchase another gift card for testing and create two separate shopping carts.
  2. Intercept both requests that apply the gift card, send them to Repeater and create a parallel request group containing both.
From the original on medium.com
  1. Send the requests simultaneously.
From the original on medium.com
  1. Both requests were accepted, and the gift card discount was applied to both shopping carts.
From the original on medium.com
  1. Returning to the application confirmed the same gift card had been used more than once.
From the original on medium.com

Why this works: each request asks the server "is this gift card unused?". Because they arrive together, both get "yes" before either one marks it as used. Both then apply the discount.

Root cause

Both bugs are time-of-check-to-time-of-use conditions where the check and the state change are not atomic. Atomic means "all at once, as a single step that cannot be interrupted". A non-atomic operation is like a shop assistant who checks the stock room, walks back to the till, and only then writes "sold" in the book: in the meantime someone else can check the same stock and sell the same item.

For refunds, the sequence was likely:

  1. The server checked whether the booking was still eligible for cancellation.
  2. Several requests passed that check almost simultaneously.
  3. Each request issued a refund.
  4. The booking was marked as cancelled only after multiple refund operations had already been processed.

For gift cards, the validation and the redemption were separate operations without sufficient concurrency protection:

  1. Request A checked whether the gift card was unused.
  2. Request B checked whether the gift card was unused.
  3. Both requests received a positive result.
  4. Both requests applied the discount.
  5. The gift card status was updated afterwards.

In both cases the application did not enforce an atomic state transition between the check and the update, so concurrent requests were all processed before the state changed. The refund operation should have been executed atomically and protected against duplicate processing.

Impact

The report lists the following consequences:

  • Unauthorised duplication of refunds.
  • Reuse of a single gift card across multiple shopping carts.
  • Direct loss of company funds or credit.
  • Incorrect financial records and reconciliation issues.
  • Potential abuse at scale through automated concurrent requests.
  • Increased support, chargeback and fraud-investigation costs.

The refund issue is described as particularly serious because it could affect both internal account credit and the original payment method.

Fix

The report does not describe a specific remediation that was applied. It states that the refund operation should be executed atomically and protected against duplicate processing.

Variants to test

  • Cancellation and refund endpoints on any booking, ticketing or subscription product. Send the same cancellation request many times in parallel and check whether the balance or the payment provider shows more than one refund for the same booking.
  • Single-use coupons and gift cards. Apply one code to two carts or two accounts in parallel. A positive result is both requests returning success and both carts showing the discount.
  • Referral and signup bonuses. Submit the same referral or bonus claim concurrently and look for the credit being granted more than once.
  • Withdrawal and transfer endpoints. Race a withdrawal against itself and check whether the balance is debited once while the payout is issued several times.
  • Inventory and seat reservation. Race two purchases of the last unit and check whether both succeed.
  • Rate-limited or quota-limited actions. Race requests against a limit and check whether more than the allowed number succeed.

In each case, record the starting state, send the requests in a single parallel group, and compare the resulting state and any downstream records (emails, ledger entries, provider dashboards) against what a single request should have produced.

Glossary

  • API: the part of a website that receives requests and does the work behind the scenes.
  • Account credit: money held in your account on a site, which you can spend on future purchases.
  • Atomic: done as a single step that cannot be interrupted or split, so nothing else can happen in the middle.
  • Burp Suite: a tool that sits between your browser and a website, letting you pause, inspect, change and resend requests.
  • Concurrency: several actions happening at the same time rather than one after another.
  • Endpoint: the specific address on a server that handles a particular action, such as cancelling a booking.
  • Gift card: a prepaid code that can be used to pay for a purchase, usually only once.
  • HackerOne: a platform where security researchers report vulnerabilities to companies.
  • HTTP 200 OK: the status code a server returns when a request succeeded.
  • Interception: pausing a request in Burp Suite before it reaches the server, so you can look at it or change it.
  • Parallel request group: a Burp Suite Repeater feature that sends several requests at the same instant.
  • Race condition: a bug where two actions arriving at almost the same time cause the program to do something it should not, because it checks something before changing it and the change happens too late.
  • Refund: returning money to a customer after they cancel a purchase.
  • Repeater: the part of Burp Suite where you can hold a request and send it again and again.
  • Request: the message your browser sends to a website when you click something.
  • Response: the message the website sends back.
  • Time-of-check-to-time-of-use (TOCTOU): a bug where the program checks a condition, then acts on it later, and the condition can change in between.
  • VDP (Vulnerability Disclosure Programme): a programme where companies receive security reports, usually without paying a reward.
  • Vulnerability: a weakness in a system that someone could abuse to cause harm.

More by Sebastian Vargas

View all

1 more disclosed report, best first.

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.