Logical 2FA / Email Verification Bypass via Pre-2FA JWT Acceptance
The server issued a JWT after the password step but before the OTP step, and that pre-2FA token was accepted by sensitive API endpoints. An attacker with valid credentials could change the email, change the password, or disable 2FA without ever entering the OTP.
This write-up describes a logical vulnerability that allowed me to bypass the Two-Factor Authentication (2FA) mechanism in a web application and email verification bypass with same idea.
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 API did not check whether the session had completed the second factor before allowing sensitive actions.
Impact
An attacker with valid credentials could change the account email, change the password, or disable 2FA without the OTP, leading to account takeover; the author notes that even if disabling 2FA were blocked, the flaw would remain.
What the attacker needed
Valid email and password; ability to intercept the login response
How it was found
- Submit the email and password at login.
- Capture the JWT returned before the OTP step.
- Send that JWT directly to API endpoints such as change email, change password, or disable 2FA.
- Observe that the requests succeed without entering the 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.
Two-factor authentication asks for a password and then a one-time code. Here the site handed out a login token too early, right after the password, and the API trusted that token for important actions. So anyone who knew the password could skip the code and still change account settings.
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.