2500$ From Login Bypassed & MFA Using a Race Condition + JWT Leak
The login lockout logic was not atomic, so sending many simultaneous login attempts allowed a correct password to be accepted before the failure count triggered a lockout. The JWT issued at that stage contained an authentication code, and submitting any random OTP with that JWT bypassed MFA and logged the attacker in.
medium.com
Published on medium.com
Hey hackers 👋 — this post is a fun deep dive into a critical authentication vulnerability I discovered during a recent security test. It combines one of my favorite web bugs (race condition) with a juicy JWT leak and ends in full account takeover — even with MFA enabled.
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 lockout check and increment were not atomic, and the JWT was issued before OTP verification while containing the auth code used for OTP validation.
Impact
An attacker could bypass login and MFA to fully compromise accounts, including those with MFA enabled, by exploiting the race condition and leaked auth code.
What the attacker needed
Knowledge of a valid username; ability to send many simultaneous requests; no CAPTCHA or throttling
The fix
The bug was fixed after being responsibly reported.
How it was found
- Create a list of password attempts including the correct one.
- Load 50+ login requests into Burp Repeater.
- Send all requests simultaneously.
- Observe a valid JWT returned despite the lockout.
- Decode the JWT to find the authCode.
- Submit any random OTP with the valid JWT to log in.
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 is when a system checks something and then acts, but another request can slip in between the check and the action. Here, the lockout counter was updated too late, so many parallel guesses let the right password through. The login token also carried a secret code that made the OTP check accept any value.
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.