2FA Bypass via OTP Reuse Across Multiple Authentication Flows
One-time passwords were not invalidated after use, so a previously issued OTP remained valid. An attacker who obtained an old OTP could reuse it to pass 2FA and passwordless login across sessions and browsers.
In this write-up, I’ll show how something that started as a P5 informational issue slowly evolved into a 2FA bypass. Turns out, sometimes bugs don’t get fixed, they just wait for you to look at them properly.
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 server did not invalidate an OTP after it was used or after a new one was issued, so old codes stayed valid.
Impact
An attacker who obtained a previously issued OTP could reuse it to bypass 2FA and passwordless login across sessions, browsers, and authentication methods.
What the attacker needed
Attacker obtains a previously issued OTP; victim account uses OTP-based login or 2FA
How it was found
- Initiate passwordless login and receive an OTP, then cancel the login attempt.
- Retry login to get a new OTP, then submit the previously issued OTP and observe it is accepted.
- Enable 2FA on the account and note the verification OTP (OTP A).
- Log out, log in with username and password, and at the 2FA prompt enter OTP A instead of the new OTP.
- Repeat the 2FA login in a different browser using OTP A.
- Initiate passwordless login with 2FA enabled and enter OTP A instead of the new OTP.
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 one-time password (OTP) is a short code sent to you to prove it is you. It is supposed to work only once and then stop working. Here, old codes kept working, so anyone who saw or guessed an old code could log in as that person.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.