MFA Bypass Exposed: A C Flaw in Two-Factor Authentication
The application failed to properly validate one-time passwords (OTPs) during multi-factor authentication, allowing an attacker to bypass the second factor by reusing a previously captured successful response with an incorrect OTP. This enabled unauthorised access to the account and proceeded directly to the payment gateway.
medium.com
Published on medium.com
Hello fellow hackers! I hope this year brings everyone the success and opportunities they’ve been working towards.
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 relied on a client-side response or failed to re-validate the OTP on each request, allowing a previously captured successful response to be replayed with an invalid OTP.
Impact
An attacker could bypass MFA and gain unauthorised access to the account, potentially proceeding to the payment gateway without possessing the correct OTP.
What the attacker needed
Ability to intercept and modify HTTP responses; a valid session or account to initiate OTP
The fix
The application should properly validate OTPs on the server side for each request and not rely on client-supplied responses.
How it was found
- Fill in the form with user details and submit to trigger an OTP.
- Enter the correct OTP and capture the successful response.
- Repeat the process with a random OTP (e.g., '000000') and capture the request.
- Intercept the request with the random OTP and replace the response with the previously captured successful response.
- Forward the modified request, which grants access and redirects to the payment gateway.
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.
Multi-factor authentication (MFA) adds a second step to logging in, often a one-time code sent to your phone. This report shows that the server did not actually check whether the code was correct; it accepted a fake code because the attacker reused a previous successful response. That means anyone could get past the second step without having the real code.
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.