How I By-pass the login page and 2FA authentication…..
The login and 2FA flows validated credentials using a static token that was the same for every request, and the client trusted the server's response body. By replacing a failed login response with a captured successful response, an attacker could log in as any user whose email or phone number they knew, bypassing both the password and the second factor.
This is my first writeup. So please don’t mind if I was not able to explain it 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.
Context
This is a first write-up from a researcher who found the bug on a private Bugcrowd program. The program name cannot be disclosed, so the researcher refers to the target as:
www.test.com/home
The feature under test is the standard account login flow. The site has a login page and a sign-up option. Two protections sit in front of a usable session: the account must have a confirmed email address, and a 2FA step is mandatory and must be enabled while creating the account. The researcher describes two attacks against this flow: a login page bypass and a 2FA authentication bypass, both achieved through response manipulation. The researcher states that complete account takeover of any user was possible with the user's email address or phone number.
Setup
The researcher created two test accounts. Burp was used as the intercepting proxy so that the login requests and responses could be inspected. No versions, endpoints, parameter names or header values are given in the report; the requests are described only in prose.
Preconditions for the flow as observed:
- The email address must be confirmed before login is allowed.
- After email confirmation, the site redirects to the 2FA authentication step.
- 2FA is mandatory to log in.
Finding it
After confirming the email address, the researcher captured the login request in Burp. Two observations stood out:
- A token is generated together with the password in the request.
- The same token is validated against the login credentials in the response, which returns status code 200 when the credentials are true.
Logging in with the second account showed the same behaviour: the same token is generated again and again and is used to validate the credentials. The researcher concluded that the same token is generated every time, and copied the request and response for the true credentials into a notepad.

The 2FA step showed the same pattern: a token is generated when the OTP is sent to the user's mobile number, and with the correct OTP the response carries the same token with status code 200, meaning a successful login.
Exploitation
Step 1: Bypass the login page
The researcher entered a wrong password and captured the request again. The same token appeared alongside the wrong password. The response was invalid credentials with status code 400.
Instead of giving up, the researcher pasted the previously saved response for the true credentials of the first account and forwarded the request. The login page was bypassed.
Step 2: Bypass the 2FA step
The next screen was the 2FA page, which the researcher expected to block the finding because 2FA is mandatory. Capturing the OTP request and response again showed the same token being generated when the OTP is sent to the user's mobile number, and with the correct OTP the response carried the same token with status code 200.
The researcher then entered a wrong OTP, captured the request and changed the response. This did not bypass the OTP at that moment: the web browser was loading.
Several attempts at response manipulation in Burp followed without success. On a final repeat of the wrong-OTP step, the researcher left the PC and went out. On returning, the screen showed a successful login into the account.
The researcher's explanation is that the web browser takes some time to complete the login. The bypass of both the login page and the 2FA was achieved purely through response manipulation.
Root cause
The report does not describe the server-side code. What it shows is that the client trusts the response it receives: when the response for the true credentials (status code 200) is substituted for the response to a wrong password (status code 400), the login page is passed. The same substitution against the OTP response was followed, after a delay, by a logged-in session. The report does not explain why the substituted response was accepted.
Impact
According to the researcher, complete account takeover of any user was possible with the user's email address or phone number. The researcher reports that the 2FA step did not stop the attack.
Fix
Based on the behaviour described, the login and OTP decisions should be made and enforced server-side, tied to a session state the client cannot forge, and a successful response should not be reusable to authenticate a different attempt.
Variants to test
- Substitute a saved 200 response for a failed login response (for example a 400 invalid credentials) and forward it. A positive result is reaching the post-login page or the next step of the flow.
- Repeat the same substitution on the OTP verification response. A positive result is a session established with a wrong OTP.
- Check whether the token described in the report changes between attempts. If it is identical across logins and accounts, it is not binding the response to a single attempt.
- After a substituted response, wait and observe the browser, since in this report the login completed only after some time. A positive result is the session appearing after a delay.
- Try the same manipulation on other multi-step flows (password reset, email confirmation) where a status code gates the next screen.
What happened, in plain words
A security researcher found a way to log into any user's account on a website, even though the site had two protections: a login page and a second factor (2FA). The trick was not to guess passwords or codes, but to tamper with the messages the website sends back to the browser. By replacing a "wrong password" message with a saved "correct password" message, the researcher bypassed the login page. The same trick, applied to the 2FA step, was followed by a successful login after a delay. The researcher reported this on a private Bugcrowd program and cannot name the site, so it is called www.test.com/home throughout.
This article explains the whole story for someone who has never done security testing. It covers what the researcher did, why each step was taken, and what it means. No prior knowledge is assumed: every technical term is explained where it first appears, and there is a glossary at the end.
The target and the protections
The researcher tested a normal login flow. The site had a login page and a sign-up option. Two protections were in place:
- The email address had to be confirmed before the account could be used.
- A second factor (2FA) was mandatory and had to be set up when the account was created.
2FA (two-factor authentication) means you need two things to log in: something you know (like a password) and something you have (like a code sent to your phone). The site sent a one-time password (OTP) to the user's mobile number. An OTP is a short numeric code that is valid only once and only for a short time.
The researcher created two test accounts to compare behaviour. To see the messages going back and forth, the researcher used Burp Suite, a tool that sits between the browser and the website and lets you pause, inspect, and change requests and responses. A request is what the browser sends to the server (for example, "here is my username and password"); a response is what the server sends back (for example, "login successful" or "wrong password").
Finding the pattern
After confirming the email address, the researcher captured the login request in Burp. Two things stood out:
- A token was generated together with the password in the request.
- The same token was validated against the login credentials in the response, which returned status code 200 when the credentials were correct.
A token here is a piece of data (often a long string) that the server uses to recognise a session or to validate a request. A status code is a three-digit number in the response that summarises what happened: 200 means OK, 400 means bad request (often used for invalid credentials).
Logging in with the second account showed the same behaviour: the same token was generated again and again and used to validate the credentials. The researcher concluded that the token did not change between attempts, and saved the request and response for the correct credentials in a notepad for later use.

The 2FA step showed the same pattern: a token was generated when the OTP was sent to the user's mobile number, and with the correct OTP the response carried the same token with status code 200, meaning a successful login.
Exploitation
Step 1: Bypass the login page
The researcher entered a wrong password and captured the request again. The same token appeared alongside the wrong password. The response was "invalid credentials" with status code 400.
Instead of giving up, the researcher pasted the previously saved response for the correct credentials of the first account and forwarded the request. The login page was bypassed.
In Burp, you can intercept a request, let it go to the server, then intercept the response before the browser sees it. By replacing the server's "invalid credentials" response with the saved "success" response, the browser was told the login worked. The saved response was forwarded in place of the rejection.
Step 2: Bypass the 2FA step
The next screen was the 2FA page, which the researcher expected to block the finding because 2FA is mandatory. Capturing the OTP request and response again showed the same token being generated when the OTP is sent to the user's mobile number, and with the correct OTP the response carried the same token with status code 200.
The researcher then entered a wrong OTP, captured the request and changed the response. This did not bypass the OTP at that moment: the web browser was loading.
Several attempts at response manipulation in Burp followed without success. On a final repeat of the wrong-OTP step, the researcher left the PC and went out. On returning, the screen showed a successful login into the account.
The researcher's explanation is that the web browser takes some time to complete the login. The bypass of both the login page and the 2FA was achieved purely through response manipulation.
Why it worked
The report does not describe the server-side code. What it shows is that the client (the browser) trusts the response it receives: when the response for the correct credentials (status code 200) is substituted for the response to a wrong password (status code 400), the login page is passed. The same substitution against the OTP response eventually produced a logged-in session. Likely the application decides whether to proceed based on the response the browser receives rather than on a server-side session state that the client cannot alter, and the token described in the report does not prevent replay of a previously captured successful response.
The report does not explain why the substituted response was accepted. The server should be the only one that decides, and it should tie that decision to a session that the browser cannot forge.
Impact
According to the researcher, complete account takeover of any user was possible with the user's email address or phone number. The researcher reports that the 2FA step did not stop the attack.
Fix
Based on the behaviour described, the login and OTP decisions should be made and enforced server-side, tied to a session state the client cannot forge, and a successful response should not be reusable to authenticate a different attempt.
Variants to test
- Substitute a saved 200 response for a failed login response (for example a 400 invalid credentials) and forward it. A positive result is reaching the post-login page or the next step of the flow.
- Repeat the same substitution on the OTP verification response. A positive result is a session established with a wrong OTP.
- Check whether the token described in the report changes between attempts. If it is identical across logins and accounts, it is not binding the response to a single attempt.
- After a substituted response, wait and observe the browser, since in this report the login completed only after some time. A positive result is the session appearing after a delay.
- Try the same manipulation on other multi-step flows (password reset, email confirmation) where a status code gates the next screen.
Glossary
- 2FA (two-factor authentication): a login method that requires two different things, such as a password and a code sent to your phone.
- API: a way for two programs to talk to each other; here, the browser and the website's server exchange requests and responses.
- Burp Suite: a tool that sits between your browser and a website so you can see and change the requests and responses.
- Client: the program on your side, usually the web browser.
- Cookie: a small piece of data a website stores in your browser to remember who you are between requests.
- Credentials: the username and password (or other proof of identity) used to log in.
- Email confirmation: a step where you click a link sent to your email to prove the address belongs to you.
- Endpoint: a specific URL where a service can be reached.
- OTP (one-time password): a code that is valid only once and usually for a short time, often sent by SMS.
- Request: a message from the browser to the server asking for something or sending data.
- Response: a message from the server back to the browser.
- Response manipulation: changing the server's response before the browser sees it.
- Session: a period during which the server remembers that you are logged in.
- Status code: a three-digit number in a response that summarises the result (200 = OK, 400 = bad request).
- Token: a piece of data used to identify a session or validate a request; if it never changes, it can be reused.
- Account takeover: gaining control of someone else's account.
- Bugcrowd: a platform where organisations invite researchers to find bugs in their systems.
- Private program: a bug bounty program that only invited researchers can see and test.
- Server-side: happening on the server, which the user cannot directly change.
- Client-side: happening in the browser, which the user can change.