MFA Bypass
MFA bypass means reaching an authenticated state without presenting the second factor. Common routes are a flow that doesn’t enforce it, a guessable or leaked code, a login path or fallback that never asks for it, or stealing the session that’s issued after it.
How it works
MFA is only as strong as the state machine around it. Each of its assumptions is its own bug class:
| Assumption | How it breaks |
|---|---|
| The second step is required before a session is usable | A session is half-issued after the password step, so the “2FA page” can be skipped by browsing directly to post-login pages ([[raw/portswigger.net/vulnerabilities-in-multi-factor-authentication-portswigger-4529 |
| The code is checked for the same user who passed step one | The verification request names the account in a client-controlled value (cookie, username), so the attacker submits their own code against the victim’s account ([[raw/portswigger.net/vulnerabilities-in-multi-factor-authentication-portswigger-4529 |
| The code can’t be guessed | No or bypassable rate limiting on short OTPs. Codes that are reusable, long-lived, cached in JS, or returned in responses ([[raw/cobalt.io/bypassing-the-protections-mfa-bypass-techniques-4359 |
| Every path to a session enforces MFA | Alternate login formats, legacy endpoints, Basic-auth headers, reset flows, OAuth/SSO logins, “remember me” tokens, backup codes, and disable-2FA endpoints reachable by CSRF or clickjacking ([[raw/deepstrike.io/two-factor-authentication-2fa-bypass-scenarios-deepstrike-4530 |
| The factor channel is private | SMS can be intercepted through SIM swap or telecom signaling (SS7/Diameter) ([[raw/portswigger.net/vulnerabilities-in-multi-factor-authentication-portswigger-4529 |
| The factor is phishing-resistant | OTP and push are relayed live by reverse proxies. The session cookie issued after MFA is the real prize (Adversary-in-the-Middle Phishing). Strong factors get downgraded by hiding or disabling them ([[raw/ioactive.com/ioactive-authentication-downgrade-mfa-bypass-4084 |
| The session dies with the credential | Stolen session cookies and OAuth tokens represent completed authentication and need no factor ([[raw/obsidiansecurity.com/token-based-attacks-how-attackers-bypass-mfa-4363 |
At org level, attackers also target conditional-access gaps and social-engineer the help desk or the user (prompt bombing) (Bugcrowd).
What to check
- After the password step, which endpoints already work with the issued cookie or token?
- Is the account identity at the code-verification step derived server-side from the step-one session, or from a client parameter?
- Response tampering: does flipping a success flag or status code change what the server allows next?
- OTP brute force: attempt counting per account (not per request, IP or session), behavior under concurrency, lockout scope, code length and TTL, single use, invalidation after success.
- Does the code ever appear in a response, a JS bundle or an error?
- Enumerate every authentication path: alternate username formats (UPN vs SAM), API/Basic auth, mobile and legacy APIs, SSO, password reset, magic links. Does each one require MFA?
- MFA management: does disabling MFA, changing the phone or email, or generating backup codes require re-auth and CSRF protection?
- “Remember this device” tokens: predictable? Portable across accounts or browsers?
- Fallback: can a user with FIDO2 enrolled be steered to SMS, OTP or push (UI hiding, user-agent switch)?
- Multi-step login state machines: race the steps (for example, change the identity bound to a flow ID between “send OTP” and “check OTP”).
Notable cases
- Gitea ≤28.3.0 (CVE-2026-123002): no TOTP attempt limit at sign-in, reset or the
X-Gitea-OTPBasic-auth header. About 800 req/s gave an expected hit in roughly 11 minutes. Fixed in 28.4.0 with a 15-minute lockout after 5 failures (writeup). - $12,000 2FA bypass: a 3-digit OTP where a request parameter controlled rate-limit enforcement (writeup).
- OTP login race: a multi-step flow keyed on a
flowId. Racing the email binding against OTP validation authenticated as another user (writeup). - SonicWall Gen6 SSL-VPN (CVE-2024-12802): UPN and SAM login formats were handled separately, so one format skipped MFA. Patched devices still needed a manual LDAP reconfiguration, and the issue was linked to ransomware (writeup).
- SilentAir: a state-level actor intercepted SMS and calls from inside Asian mobile operators by abusing SS7/Diameter
UpdateLocation(THN). - FIDO downgrade: IOActive rewrote Entra ID’s method list through a Cloudflare Workers proxy to hide FIDO2, a pattern also seen with 0ktapus and Scattered Spider (IOActive). Proofpoint spoofed a user agent that Entra doesn’t offer FIDO to (Proofpoint).
Defenses
- Model login as a server-side state machine. Issue no usable session until every required factor is satisfied, and bind each step to the same server-side principal.
- Count failed attempts per account and per code, atomically. Use lockout or backoff, short TTLs, single-use codes, and never return codes to the client (Gitea fix).
- Enforce MFA on every authentication path, including reset, API and legacy formats. Require re-authentication to change or disable factors (OWASP).
- Prefer phishing-resistant FIDO2/passkeys. For users who have them, require them with no fallback to SMS, OTP or push, and alert when a FIDO user suddenly authenticates another way (IOActive).
- Reduce token-theft impact with device-bound credentials and token binding, short session lifetimes, and revocation on risk (Obsidian).
- Retire SMS for high-value accounts (SilentAir).
Related
- Authentication Security · Passkeys and WebAuthn · Adversary-in-the-Middle Phishing · Device Code Phishing · Session Management · Password Reset Vulnerabilities · Account Takeover
- API Rate Limiting · GraphQL Batching Attacks · Mobile Application Security
Sources
- Vulnerabilities in multi-factor authentication (PortSwigger) · original
- Bypassing the Protections: MFA Bypass Techniques · original
- Broken authentication: 7 Advanced ways of bypassing 2-FA (Intigriti) · original
- Bug-Bounty-Methodology: 2FA testing · original
- Two-Factor Authentication (2FA): Bypass Scenarios (DeepStrike) · original
- CVE-2026-123002: How I Found a 2FA Bypass in Gitea and Wrote the Patch · original
- The $12,000 2FA Bypass - So Simple, Yet So Critical · original
- Race Condition Authentication Bypass: Full Account Takeover · original
- Beyond the Patch: Understanding the SonicWall SSL-VPN MFA Bypass Exposure · original
- SilentAir Hijacks Asian Telecom Networks to Intercept SMS 2FA Codes and Spy on Taiwanese Users · original
- IOActive: Authentication Downgrade / MFA Bypass · original
- Proofpoint: FIDO Authentication Downgrade · original
- Token-Based Attacks: How Attackers Bypass MFA · original
- Bugcrowd: How attackers bypass multi-factor authentication (Part 1) · original
- OWASP Authentication Cheat Sheet · original