Skip to content
Race condition Write-up Advanced

Smashing the state machine: the true potential of web race conditions

The paper introduces new classes of web race condition beyond simple limit-overrun, exploiting the brief sub-states an application passes through while handling a single request. It also presents the single-packet attack, which sends many requests in one TCP packet to defeat network jitter and make small race windows reliably exploitable.

James Kettle Follow

Published on portswigger.net

For too long, web race condition attacks have focused on a tiny handful of scenarios. Their true potential has been masked thanks to tricky workflows, missing tooling, and simple network jitter hiding all but the most trivial, obvious examples.

James Kettle (@albinowax), on portswigger.net

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application processes concurrent requests against shared state without proper synchronisation, so the gap between a security check and the protected action can be exploited.

Impact

Attackers could bypass limits and business logic, and in one described case gain super-admin privileges by skipping a role-selection step, though the paper notes some defences such as session locking can limit exploitation.

What the attacker needed

Ability to send concurrent requests; HTTP/2 support for single-packet attack; a target endpoint with shared state

The fix

Applications should be fixed by synchronising access to shared state, for example with locking, so concurrent requests cannot both pass a check before either acts.

How it was found

  1. Identify objects with security controls worth bypassing, such as users and sessions.
  2. List endpoints that write to or read from those objects.
  3. Rule out endpoints unlikely to collide by asking how state is stored, whether data is edited or appended, and what the operation is keyed on.
  4. Benchmark normal endpoint behaviour by sending requests a few seconds apart.
  5. Send all requests at once using the single-packet attack and look for deviations from the benchmark.
  6. Reduce to two requests and retry or automate to prove the exploit.

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 write-up has not been written yet. The Original tab links to the source.

A race condition happens when a website does two things at almost the same moment and the result depends on which finishes first, like two people grabbing the last ticket at once. Normally attackers struggle to make requests arrive together because the network delays packets unpredictably. This paper shows a trick that puts many requests into one network packet so they all reach the server at the same instant, and explains how to look for hidden in-between states that can be abused.

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 James Kettle

View all

10 more disclosed reports, 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.