Skip to content
Account takeover Disclosed report Beginner CVE-2021-30120

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.

mikelly Follow

Originally disclosed on HackerOne

  • 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:

  1. The security benefit of 2FA is nullified.
  2. 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

  1. Create an account at ████████
  2. Log in using valid credentials (email and password) at ███████
  3. A 6 digit 2FA code will be sent to your email, and you will be prompted to enter this 6 digit 2FA code
  4. Enter a wrong 2FA code and make sure to intercept the response to this request
  5. Observe that the intercepted response body will have a status of 3 that is status: 3 indicating an incorrect OTP code
  6. Modify the status value from 3 (incorrect code) to 1 (indicating a correct code).
  7. Forward the modified response and observe that you are now logged into the account, bypassing the 2FA process entirely.

Suggested Mitigation/Remediation Actions

  1. Ensure that 2FA verification is fully performed server-side without relying solely on client-side or response manipulation for authentication state changes.
  2. Validate the OTP server-side before granting access and ensure no client-side response or manipulation can override the server's verification logic.

The original report as published on HackerOne, by mikelly. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Create an account on the target site.
  2. Log in with valid email and password.
  3. Receive a 6-digit 2FA code by email and get prompted to enter it.
  4. Enter a wrong 2FA code and intercept the response.
  5. Observe the response body contains a status field set to 3 (incorrect code).
  6. 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.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.