How I Bypassed a Broken 2FA Implementation Using Response Manipulation
The application's client-side code decided whether two-factor authentication succeeded based on the API response status, rather than the server enforcing it. An attacker with valid credentials could modify the failed OTP response to a success response and gain access to the account without the correct OTP.
Published on anupamas02.medium.com
While testing a web application for security weaknesses, I came across a critical flaw: I was able to bypass the site’s two-factor authentication (2FA) entirely using a simple trick with response tampering.
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 enforce OTP verification and instead relied on the client to interpret the API response status to decide whether to grant access.
Impact
An attacker with valid credentials could bypass 2FA and achieve full account takeover, potentially leading to financial loss or data theft.
What the attacker needed
Valid username and password; ability to intercept and modify HTTP responses
How it was found
- Log in with valid credentials and reach the OTP prompt.
- Enter a wrong OTP on purpose.
- Capture the request and response using Burp Suite.
- Intercept the failure response and modify it to look like a success.
- Forward the modified response and observe access to the dashboard.
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 (2FA) asks for a second proof, like a one-time code, after your password. Here, the website's front end trusted a message from the server saying 'login successful' instead of the server itself checking the code. So someone who edited that message in their browser's network traffic could get in without 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.