Skip to content
Race condition Write-up Intermediate

$2,500 Bug Bounty Lesson in OAuth: How Race Conditions Can Break

The report describes a race condition in OAuth 2 implementations where concurrent requests can redeem the same authorization code or refresh token, potentially creating multiple valid token pairs. If revocation does not invalidate all tokens from the same grant, a user may revoke access but an old token continues to work.

Monika Follow

Published on meetcyber.net

What if a user clicks “Revoke Access”, expects an application to lose access to their account, but an old token continues working?

Monika, on meetcyber.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 validation and consumption of a one-time credential are not atomic, allowing concurrent requests to both pass the check before either marks the credential as used.

Impact

If revocation does not invalidate every token associated with the authorization grant, a user may lose the ability to reliably disconnect an application, as an old token could continue to work.

What the attacker needed

Authorized test environment; control of an OAuth client and account

The fix

The server should validate and consume an authorization code as a single atomic operation, coordinate concurrent refresh attempts, associate tokens with an authorization grant, and enforce revocation consistently.

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.

OAuth is a way for apps to access your account without your password. A race condition happens when two actions occur at almost the same time and the system gets confused. Here, if two requests try to use the same one-time code simultaneously, both might succeed, creating extra valid tokens. Later, even if you revoke access, one of those extra tokens might still work.

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.

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.