2FA Bypass via Response Manipulation on Login Page
The 2FA verification response could be intercepted and its status field changed from 3 (incorrect code) to 1 (correct code), allowing login without a valid 2FA code. An attacker with valid credentials could bypass 2FA entirely.
- Triaged in 20 hours
- Fixed in 2 months
- Disclosed after 11 months
Description: I discovered a vulnerability in the Two-Factor Authentication (2FA) mechanism of your website, stemming from an insecure design flaw. The issue arises from the way the system handles 2FA verification. Specifically, the verification process can be bypassed by intercepting and manipulating the server's response. As a result, an attacker can gain unauthorized access to an account after providing the correct login credentials, without the need to submit the correct 2FA code. This flaw highlights a weakness in the design of the 2FA flow, where the server fails to enforce proper security checks after the initial login phase.
References
https://hackerone.com/reports/1943252
Impact
This vulnerability allows an attacker with valid credentials (email and password) to completely bypass the 2FA mechanism. As a result:
- The security benefit of 2FA is nullified.
- Accounts are susceptible to unauthorized access if credentials are compromised through phishing, leaks, or other means.
System Host(s)
██████████
Affected Product(s) and Version(s)
Custom website hosted at ████████
CVE Numbers
CVE-2021-30120
Steps to Reproduce
- Create an account at ████████
- Log in using valid credentials (email and password) at ███████
- A 6 digit 2FA code will be sent to your email, and you will be prompted to enter this 6 digit 2FA code
- Enter a wrong 2FA code and make sure to intercept the response to this request
- Observe that the intercepted response body will have a status of 3 that is status: 3 indicating an incorrect OTP code
- Modify the status value from 3 (incorrect code) to 1 (indicating a correct code).
- Forward the modified response and observe that you are now logged into the account, bypassing the 2FA process entirely.
Suggested Mitigation/Remediation Actions
- Ensure that 2FA verification is fully performed server-side without relying solely on client-side or response manipulation for authentication state changes.
- Validate the OTP server-side before granting access and ensure no client-side response or manipulation can override the server's verification logic.
Not written yet. The AI write-up for this report 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 field to determine 2FA success instead of validating the code server-side.
Impact
An attacker with valid credentials could bypass 2FA and gain unauthorized access to an account, nullifying the security benefit of 2FA.
What the attacker needed
Valid email and password; ability to intercept HTTP responses
The fix
2FA verification should be fully performed server-side, validating the OTP before granting access, without relying on client-side response manipulation.
How it was found
- Create an account on the target site.
- Log in with valid email and password.
- Receive a 6-digit 2FA code by email and get prompted to enter it.
- Enter a wrong 2FA code and intercept the response.
- Observe the response body contains a status field set to 3 (incorrect code).
- Change the status value from 3 to 1 and forward the response to log in.
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 report has not been written yet. The Original tab links to the source.
Two-factor authentication (2FA) adds a second step after your password, usually a code sent to your email or phone. Here, the website trusted a value in the response it sent to the browser to decide if the code was correct. By changing that value, someone with the password could skip the second step.
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.