2FA Bypass Techniques
by Harsh Bothra
1. Password Reset/Email Change - 2FA Disable
1.1. 1. Assuming that you are able to perform email change or password reset for the victim user or make victim user do it by any means possible.
1.2. 2. 2FA is disabled after the email is changed or password is reset. This could be an issue for some organizations. However, depends on case by case basis.
2. 2FA Code Leakage in Response
2.1. 1. At 2FA Code Triggering Request, such as Send OTP functionality, capture the Request.
2.2. 2. See the Response of this request and analyze if the 2FA Code is leaked.
3. JS File Analysis
3.1. While triggering the 2FA Code Request, Analyze all the JS Files that are referred in the Response to see if any JS file contain information that can help bypass 2FA code.
4. Response Manipulation
4.1. 1. Check Response of the 2FA Request.
4.2. 2. If you Observe "Success":false
4.3. 3. Change this to "Success":true and see if it bypass the 2FA
5. Status Code Manipulation
5.1. 2. Change the Response Status Code to "200 OK" and see if it bypass the 2FA
5.2. 1. If the Response Status Code is 4XX like 401, 402, etc.
6. 2FA Code Reusability
6.1. 1. Request a 2FA code and use it
6.2. 2. Now, Re-use the 2FA code and if it is used successfully that's an issue.
6.3. 3. Also, try requesting multiple 2FA codes and see if previously requested Codes expire or not when a new code is requested
6.4. 4. Also, try to re-use the previously used code after long time duration say 1 day or more. That will be an potential issue as 1 day is enough duration to crack and guess a 6-digit 2FA code.
7. Lack of Brute-Force Protection
7.1. This involves all sort of issues which comes under security misconfiguration such as lack of rate limit, no brute-force protection, etc.
7.1.1. 1. Request 2FA code and capture this request.
7.1.2. 2. Repeat this request for 100-200 times and if there is no limitation set, that's a rate limit issue.
7.1.3. 3. At 2FA Code Verification page, try to brute-force for valid 2FA and see if there is any success.
7.1.4. 4. You can also try to initiate, requesting OTPs at one side and brute-forcing at another side. Somewhere the OTP will match in middle and may give you a quick result.