Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A race condition is a flaw in which the outcome depends on the timing of concurrent operations, letting an attacker exploit the gap between a check and the action that follows it.

What Is a Race Condition?
Software that assumes operations happen one after another usually behaves correctly until two requests arrive at the same moment. A race condition is the resulting flaw: the outcome depends on timing rather than on logic, and an attacker who can control the timing can produce an outcome the developer never intended. MITRE catalogues the general form as CWE-362 and the most common web variant, time-of-check to time-of-use, as CWE-367.
Almost every exploitable case has the same structure. The application reads a value, decides something based on it, and then acts. Between the read and the write there is a window, usually a few milliseconds, during which the value can change. Send two requests inside that window and both pass the check:
balance = read(account) // both requests read 100
if (balance >= amount) // both see enough funds
write(account, balance - amount) // both write 50
The account has paid out twice and lost one payment’s worth of money. The same pattern applies to redeeming a single-use voucher, accepting an invitation to a workspace, claiming a limited quantity of stock, and counting failed login attempts.
What changed the picture for web applications was the realisation that the window can be made far more reliable. At Black Hat USA in August 2023, James Kettle presented the single-packet attack, which uses HTTP/2 to place the final bytes of twenty or thirty requests into one TCP packet, removing network jitter almost entirely and delivering them to the server within a fraction of a millisecond of each other. Techniques that previously succeeded occasionally became dependable, and classes of bug that had been dismissed as theoretical turned out to be exploitable in production systems.
The practical consequences include redeeming one gift card many times, bypassing an anti-brute-force counter by submitting all attempts simultaneously, exceeding a rate limit that is enforced per completed request, and converting a single-use password reset token into several valid sessions. Turbo Intruder and the Burp Suite repeater group feature implement the technique.
Race conditions are not a web phenomenon. Dirty COW, CVE-2016-5195, disclosed on 19 October 2016, was a race in the Linux kernel’s copy-on-write handling that allowed any local user to write to read-only files and escalate to root; it had been present since 2007 and was found through observed exploitation. Filesystem races where a privileged process checks a path and then opens it, allowing a symbolic link to be swapped in between, are a standing hazard in installers and backup agents.
UPDATE accounts SET balance = balance - 50 WHERE id = 1 AND balance >= 50 cannot be interleaved, and the affected row count tells you whether it succeeded.SELECT ... FOR UPDATE inside a transaction, so a second transaction waits rather than reading stale state.These flaws are invisible to a scanner that sends one request at a time, and they are equally invisible to manual testing performed at human speed. Finding them means identifying every endpoint where a limit, a quantity, or a single-use token is involved, then firing concurrent requests at it and checking the resulting state. Logs help afterwards: several identical operations on one object within the same millisecond is a distinctive signature worth alerting on. Because the outcomes map directly onto money and entitlement, these defects sit close to business logic flaws, and both are covered in our web application security testing.
Because automated scanners send requests sequentially and judge each response on its own. A race condition only manifests when two or more requests are processed concurrently, and the evidence is in the resulting state rather than in any single response. Detecting it requires deliberately concurrent requests and a check of the data afterwards, which is a manual test design rather than a signature.
Usually not, and the two are often the same bug. If the rate limiter increments a counter after each request completes, simultaneous requests all read the same counter value and all pass. Enforcing the limit atomically, for example with an atomic increment in Redis evaluated before processing, is what makes it effective against concurrent traffic.
A technique that uses HTTP/2 multiplexing to send the final bytes of many requests inside one TCP packet, so the server begins processing them within a fraction of a millisecond of each other. It removes network jitter, which was previously the main obstacle to exploiting narrow timing windows, and made many theoretical race conditions reliably exploitable from across the internet.
Anything with a limit or a single use: payment and withdrawal flows, voucher and discount redemption, referral bonuses, stock allocation on limited items, invitation acceptance, password reset tokens, and rate-limited or attempt-limited actions. Also check any workflow that moves an object between states, where two concurrent transitions may both be accepted.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.