
This series has covered a lot of ground: data becoming SQL, data becoming JavaScript, a forged browser intention, the server’s own fetch client working for you, a parser resolving things it should not, an identifier with no ownership check. Every one of those bugs lives in a single request, examined carefully. Today’s bug class does not live in any single request at all. It lives in the gap between two requests that were never supposed to overlap.
A Race Condition exists when an application’s correctness depends on operations happening in a specific order, a check, then an action, and an attacker can get two requests to run so close together that the check from one and the action from another collide. Nothing about either individual request looks wrong. The vulnerability is purely about timing.
Inside scope only, with your own accounts and the smallest quantities possible. Race conditions abuse things like balances, redemption limits, and vote or like counts. Prove the flaw happened, do not drain anything.
What a race condition actually is
Almost every “use once” or “limited” feature in a web application follows the same internal pattern, often called Time Of Check to Time Of Use, TOCTOU:
- Check: has this coupon already been redeemed? Is the balance sufficient? Has this action already happened?
- Act: redeem the coupon, deduct the balance, perform the action.
If step 1 and step 2 are not wrapped in a single atomic operation, there is a window between them. Fire two requests for the same action at almost the exact same instant, and both can pass the check before either has finished the act, because neither request has recorded its result yet when the other one reads the current state.
Request A: check balance ($10) -> OK, balance sufficient
Request B: check balance ($10) -> OK, balance sufficient (fired within milliseconds of A)
Request A: deduct $10 -> balance now $0
Request B: deduct $10 -> balance now -$10
Both requests used a coupon that should only work once, withdrew money that should only come out once, or performed an action that should only count once. Nothing in either request was malformed. The flaw is entirely in the gap between reading state and writing it back.
Why this still works on modern applications
Developers know about race conditions in theory, and most frameworks offer database transactions and row locking specifically to prevent this. Three things keep the bug alive anyway.
Distributed systems widen the gap. A monolith with one database connection pool has fewer places for this to go wrong. A modern application calling three microservices, a payment service, an inventory service, and a notification service, has far more places where a check in one service and an act in another are not atomic together, even if each service is individually well written.
Caching and queues introduce their own windows. A value read from a cache, updated, and written back is a textbook race condition pattern, and caching is everywhere in modern applications for exactly the performance reasons that make the race window matter.
HTTP/2 made exploitation dramatically easier. The classic difficulty with race conditions was network jitter, getting two requests to actually arrive within the same few milliseconds server-side, since even sending them at the same moment from your machine, normal TCP connection setup and network routing could still let them land apart. HTTP/2’s single-connection multiplexing lets a tool send many requests in the same TCP packet, collapsing that jitter to near zero and making races that used to require luck now reliably exploitable. This technique, often called “single-packet attack,” is the reason race condition findings have become far more common in disclosed reports over the last few years.
Real disclosed reports
- Cosmos Starport, crypto faucet race condition, $5,000, severity 9.3. Reported by two researchers working together, cyberboy and z0mb13, this flaw let an attacker request funds from the Starport implementation’s crypto faucet multiple times concurrently, each request passing the “has this address already claimed” check before any of the parallel claims were recorded, before the eligibility flag was set. The severity rating reflected how directly the bug translated into free cryptocurrency.
- HackerOne’s own platform, race condition allowing duplicated payments. Reported by a researcher through HackerOne’s own bug bounty program, this flaw involved performing a retest action that, run concurrently, allowed the same bounty payment to be triggered more than once, a direct financial impact on the platform’s own payout system.
- HackerOne’s own platform, race condition leads to undeletable group member. A user could add themselves to a group twice through two concurrent requests, and the resulting duplicate membership state could not be cleanly removed afterward, a logic consistency bug rather than a financial one, which shows race conditions do not always need money involved to be a valid, reportable finding.
- Shopify, race condition in adding team members. A disclosed report showed that concurrent requests to add a team member could bypass intended limits or checks on who could be added and with what role, demonstrating the same pattern applied to access control rather than a balance.
- curl, CVE-2023-32001, fopen race condition. Not a web application but a well known piece of infrastructure software, this CVE, paid through the Internet Bug Bounty program, shows that the exact same TOCTOU pattern, check a file’s state, then act on it, applies to systems programming just as much as it does to a web balance field.
Read the Cosmos Starport report first. It is the clearest illustration of the “concurrent requests beat the eligibility check” pattern, and the writeup explicitly walks through using an automated concurrent request tool to win the race reliably rather than by luck.
The variants worth knowing
Limit-once abuse. Coupon codes, referral bonuses, free trial activations, and “redeem once” rewards are the classic target, because the entire feature’s value depends on the once-only guarantee holding.
Balance and inventory races. Wallet balances, gift card values, loyalty points, and stock counts, where firing withdrawal or purchase requests concurrently can produce a negative balance or oversold inventory, exactly the Reverb.com gift card pattern and the Cosmos faucet pattern above.
Workflow state races. Multi-step processes, like account verification, password reset, or order status transitions, where firing two requests for different steps at once can leave the object in a state the application never expected and never built logic to handle, like the HackerOne undeletable group member case.
Limit and rate-limit bypass races. Features that cap how many times an action can be performed, number of votes, number of login attempts, number of API calls, where the counter increment itself is subject to the same check-then-act gap.
Authorization races. Two concurrent requests, one that adds a user to a privileged group and one that reads current group membership to decide what a user can do, can occasionally be sequenced so an action briefly executes with permissions that should not yet, or should no longer, apply.
Where to look, pointed at your recon
- Anything with the word “once,” “limit,” or “first” in its business logic. Coupons, referral codes, sign-up bonuses, first-purchase discounts, one-time trial activations.
- Financial and point-based actions. Wallet top-ups, withdrawals, gift card redemption, loyalty point spending, in-app currency purchases.
- Voting, liking, and rating features, where double-counting is a lower severity but still valid and often overlooked finding.
- Multi-step account flows. Email verification, password reset, two-factor enrollment and reset, exactly the kind of flow where HackerOne itself found a medium-severity race condition in its own 2FA reset process during an internal review.
- Any endpoint your recon flagged as rate-limited, since the rate limit counter is itself frequently implemented with the same vulnerable read-then-increment pattern it is meant to protect against.
- Group and team membership management, add member, remove member, change role, as the Shopify and HackerOne group examples both show.
How to hunt it, step by step
Step 1: identify candidate actions. From the categories above, list every action in the target that is supposed to happen only once, or only up to a fixed limit, per user.
Step 2: understand the normal flow first. Perform the action once, normally, and confirm the expected single-use behavior works as intended before trying to break it.
Step 3: fire the same request multiple times, concurrently, not sequentially. This is the critical distinction. Sending ten requests one after another, waiting for each response, almost never triggers a race condition, because the server has time to update its state between each one. You need them to land within the same narrow window.
Step 4: use a tool built for this, not a basic script. Manually spamming a button is not a serious test; the jitter is too high. Tools purpose-built for race condition testing send many requests through the same underlying connection to minimize timing variance:
- Burp Suite’s built-in Repeater “send group in parallel” feature, specifically its “single-packet attack” mode for HTTP/2 targets, is the current standard approach and requires no scripting.
race-the-web, written in Go specifically for this kind of testing, remains a solid option for HTTP/1.1 targets where the single-packet technique does not apply.
Step 5: look at the result, not just the response codes. A race condition often does not produce an error on either request individually, both may return 200 OK. The evidence is in the final state: did the coupon get used twice, did the balance go negative, did the counter exceed its stated limit. Check the actual account state after the burst, not just the immediate responses.
Step 6: narrow the window if the first attempt fails. If concurrent requests do not immediately win the race, try varying the exact number of parallel requests, the specific endpoint variant (some multi-step flows have a narrower vulnerable window at one particular step), and whether HTTP/2 multiplexing is supported by the target, since the single-packet technique only works on HTTP/2 connections.
Writing the race condition report
Title: Race condition in [feature] allows [limit bypass/duplicate action/negative balance]
Summary:
One sentence: which endpoint or feature, what check is bypassed by
concurrent requests, and what state results.
Steps to Reproduce:
1. As a test account with [starting state, e.g. one unused coupon
code, a $X balance], send N concurrent requests to [endpoint]
using [tool, e.g. Burp's parallel Repeater group / race-the-web],
with 0ms or near-0ms delay between them.
2. Observe that [N or more than 1] of the requests succeeded,
despite the feature's intended single-use or limit constraint.
3. Confirm the resulting account state shows [duplicated reward /
negative balance / exceeded limit].
(Exact request, the tool configuration used, before-and-after state
screenshots, and the number of requests sent versus the number that
succeeded.)
Impact:
An attacker can exploit the timing gap between the application's
eligibility check and the action it guards, to [redeem a limited
resource multiple times / gain more than the intended amount of
X]. State the realistic financial or logical impact clearly, since
this is usually the entire severity argument for this bug class.
Remediation:
Enforce the check-then-act sequence atomically, using database
level transactions, row locking (for example SELECT ... FOR UPDATE),
or a unique constraint that makes a second concurrent write fail
outright rather than silently succeed. Idempotency keys on
client-submitted requests are a strong complementary defense for
payment and redemption style endpoints specifically.
Strong race condition reports share one trait above all others: a before-and-after comparison that unambiguously shows the limit was exceeded, with the exact number of concurrent requests sent and the exact number that succeeded. A report that just says “I think this might be exploitable” without that count is far weaker than one that says “sent 20 concurrent requests, 14 succeeded, intended limit was 1.”
What programs often reject
- Race conditions with no meaningful impact, like a cosmetic counter briefly showing a wrong number that self-corrects
- Findings that only work with an unrealistic number of concurrent requests the researcher’s own infrastructure needed to simulate but a real attacker could not reasonably achieve
- Reports with no clear before-and-after state evidence, just a claim that it “should” be exploitable
- Rate-limit bypass findings on features explicitly documented as having generous or non-strict limits by design
The mindset: time is also an input
Every earlier class in this series asked what happens to a piece of data as it moves through the system. Race conditions ask a different question entirely: what happens when two pieces of data arrive at the same moment. The vulnerability is never visible by reading a single request in isolation, which is exactly why it survives in applications that have already been carefully reviewed for every other bug class on this list. Once you start asking “what if this ran twice, at once” about every check-then-act flow you see, this becomes one of the more reliable bug classes to find on well-hardened targets that have already been picked over for SQLi, XSS, and IDOR.
Homework for Day 11
- From your recon, list every “once,” “limited,” or counted action on the target: coupons, referral rewards, balance operations, votes, group membership changes.
- Pick one low-risk candidate and fire a burst of concurrent requests using Burp’s parallel Repeater group or race-the-web, starting with a modest number like 10 to 20.
- Compare the before and after account state carefully, not just the HTTP response codes, to determine whether the limit was exceeded.
- If the first attempt does not win the race, vary the number of concurrent requests and check whether the target supports HTTP/2 for the single-packet technique.
- Read the Cosmos Starport faucet report end to end. Note exactly how the eligibility check was structured, how the researchers proved the parallel requests all passed it, and how they stated the impact to justify the 9.3 severity score.
A confirmed race condition with clear financial or access control impact is typically high severity, and one with a direct, repeatable financial gain, like the Starport faucet case, can reach critical. Document it with the exact concurrent request count and the before-and-after state, and recommend atomic transactions or idempotency keys as the fix.
Day 12 moves to a bug where the application trusts a string you can forge, authentication and session tokens built on JSON Web Tokens, and the algorithm confusion and signature bypass tricks that still work against them.