My name is Hassan Jawaid, and I have pursued a dynamic career in security research, uncovering critical vulnerabilities and contributing to the safety of digital ecosystems. In this writeup, I want to shed light on a critical security aspect — multi-factor authentication (MFA). While MFA is designed to bolster security, attackers often find ingenious ways to bypass it.
My goal is to provide a deep dive into these techniques, sharing real-world examples from my bug bounty hunting journey to help others understand and defend against these attacks.
Understanding Multi-Factor Authentication
Multi-factor authentication is a security mechanism that requires users to verify their identity through multiple layers, typically combining something they know (password), something they have (a device or token), and something they are (biometrics). Despite its robustness, MFA isn't foolproof. Threat actors are continually evolving their methods to bypass even the most advanced authentication systems.
A common oversight is the lack of rate limiting on the 2FA code parameter, which allows attackers to brute-force one-time passwords. Since 2FA codes are typically 4–6 digits, the absence of attempt limits makes it feasible to guess the correct code within its validity window.
Steps to Reproduce
- Log in to the target application with valid credentials and initiate the 2FA process.
- Use Burp Suite or OWASP ZAP to capture the request sent to the 2FA verification endpoint (e.g.,
POST /api/2fa/verify). - Automate submission of multiple requests using Burp Intruder or a custom Python script, cycling through all possible codes (000000–999999).
- Observe whether the server allows unlimited attempts within the code's validity period.
This vulnerability exploits a flaw in the password reset flow — the process allows full account access without triggering the SMS-based 2FA code verification, completely bypassing the second factor.
Steps to Reproduce
- Log in, enable SMS-based 2FA, then log out.
- Set up Burp Suite to monitor HTTP traffic.
- Navigate to the password reset page and request a reset link.
- Use the reset link to change your password — observe that you are logged in directly without 2FA verification.
Rate limiting on OTP submissions was enforced at the IP level. By rotating IPs through a VPN or proxy, the rate limit could be completely bypassed, making OTP brute-forcing trivially scalable.
Steps to Reproduce
- Visit the password reset page and submit a valid email to trigger an OTP.
- Enter incorrect OTPs multiple times until your IP is blocked.
- Switch to a new IP via VPN or proxy.
- Resume OTP attempts — the counter resets, allowing continued brute-forcing.
- Repeat until the correct OTP grants access.
The server's JSON response included a requires_2fa parameter. By intercepting and modifying the response before it reached the client, the 2FA requirement could be silently disabled.
Steps to Reproduce
- Navigate to the login page and enter valid credentials.
- Intercept the server's response in Burp Suite.
- Modify
"requires_2fa":"GoogleAuthenticator"→"requires_2fa":null. - Forward the modified response — login succeeds without 2FA.
The platform's Chrome extension login flow did not enforce 2FA. Logging in through the extension granted full dashboard access without triggering the second factor, even when 2FA was enabled on the account.
Steps to Reproduce
- Enable 2FA on your account at redacted.com.
- Download and install the platform's Chrome extension.
- Click the extension icon and log in with your credentials.
- Observe: you are granted full access without any 2FA prompt.
After a temporary account lockout due to multiple failed login attempts, the 2FA verification step was dropped upon re-login once the lockout period expired — a misconfiguration in the post-lockout authentication flow.
Steps to Reproduce
- Log in, enable 2FA, and log out.
- Enter the wrong password 10 times to trigger a 1–2 hour lockout.
- Wait for the lockout period to expire.
- Log in again with correct credentials — 2FA is not prompted.
Password reset links generated before 2FA was enabled were not invalidated when 2FA was activated. Using a stale reset link after enabling 2FA logged the attacker directly into the dashboard without a 2FA challenge.
Steps to Reproduce
- Request a password reset link but do not use it.
- Enable 2FA on the account.
- Log out, then use the previously generated (now stale) reset link.
- After resetting the password, you are logged in to the dashboard with no 2FA prompt.
Backup codes generated by the platform failed at the validation layer — an error "Value must be less than or equal to 999999" was thrown, rendering all backup codes permanently unusable for accounts with 2FA enabled.
Steps to Reproduce
- Enable 2FA and save the backup codes provided.
- Log out and attempt to log in using a backup code.
- Observe the error:
"Value must be less than or equal to 999999" - No backup code from the generated set works.
When logging in via Facebook OAuth, the 2FA verification step was entirely skipped — even if 2FA was enabled on the account. An attacker who compromised a victim's Facebook account could use OAuth to access the target platform with no 2FA friction.
Steps to Reproduce
- Enable 2FA on your account.
- Log out, then log in via "Continue with Facebook".
- Observe: you land directly on the dashboard with no 2FA prompt.
A race condition in a single-page application allowed bypassing newly-enabled 2FA by exploiting a login session that was partially initiated before 2FA was turned on — across two separate browser instances.
Steps to Reproduce
- In Browser 1, navigate to
https://redacted.com/vault/. - In Browser 2, open
https://redacted.com/vault/beta/and enter the email — pause at password. - In Browser 1, complete login, go to account settings, and enable 2FA.
- Return to Browser 2, complete login by entering the password.
- Result: logged in without a 2FA prompt.
An unauthenticated attacker with only login credentials could retrieve the victim's full phone number by manipulating the content type of the "Resend Code" request — switching from JSON to XML exposed the phone number in the response payload, even without entering the 2FA code.
Steps to Reproduce
- Ensure the victim account has 2FA enabled.
- Log in with the victim's credentials — you will be prompted for 2FA.
- Click "Resend Code" and intercept the request in Burp Suite.
- Change the
Content-Typefromapplication/jsontoapplication/xml. - The XML response includes the victim's full phone number.
Final Thoughts
These case studies underscore the importance of rigorous and continuous security testing, especially in areas often considered "safe" due to widely adopted mechanisms like MFA. As seen throughout this research, even minor oversights — improper response handling, token reuse, or broken session management — can completely undermine otherwise robust security controls.
Responsible disclosure is not just about reporting bugs; it's about contributing to a more secure digital ecosystem for users and organizations alike. Every vulnerability shared and patched strengthens the collective resilience of the internet.
If you're looking for a professional penetration test for your web, mobile, or API applications — reach out to VAPT.PK. You can also find me on X (Twitter) or Medium.
Stay curious, stay ethical — and remember, one well-crafted request can uncover vulnerabilities that others miss.