Race Conditions

Date: 11-02-2026- Platform: TryHackMe- Difficulty: Easy- PT1 Exam Preparation

Overview

Race conditions happen when the outcome of a workflow depends on timing: two (or more) concurrent requests hit shared state and the app fails to enforce correct ordering/atomicity. In web apps, that often means you can double-spend, apply discounts multiple times, bypass limits, or desync account state.

Core idea: Time-of-Check to Time-of-Use (TOCTOU). The app checks something, but the state changes before it uses that result.

1) Classic real-world + web impact examples

Signal: anything involving balance, inventory, redemption, or state transitions is a candidate.

2) Why it happens

It’s usually shared state + concurrency + missing locks/transactions.

3) Mental model: state machines

Most race bugs are broken state transitions. If the app has states like created → paid → shipped, a race can let you trigger transitions out of order or twice.

Attack plan: identify the state-changing request, then send it concurrently before the server commits the first transition.

4) Testing workflow (Burp Suite Repeater)

  1. Find the sensitive action endpoint (apply coupon, redeem, transfer, checkout).
  2. Capture a valid request (including auth/session headers).
  3. Send the same request concurrently (or send a pair: check + execute) to trigger TOCTOU.
  4. Compare outcomes: did you get duplicated effects or inconsistent state?

Goal: two requests should not both succeed if the business rule says only one should.

5) What to look for (high-signal targets)

6) Remediation (report-ready)

Exam Notes (PT1) — Race Condition checklist