# 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|PortSwigger]]). A client-side decision can be manipulated in the response body or status code ([[raw/cobalt.io/bypassing-the-protections-mfa-bypass-techniques-4359|Cobalt]]). |
| 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|PortSwigger]]). |
| 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|Cobalt]], [[raw/github.com/bug-bounty-methodology-2fa-testing-4541|2FA methodology]]). |
| **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|DeepStrike]], [[raw/intigriti.com/broken-authentication-7-advanced-ways-of-bypassing-2-fa-intigriti-4528|Intigriti]]). |
| 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|PortSwigger]], [[raw/thehackernews.com/silentair-hijacks-asian-telecom-networks-to-intercept-sms-2fa-codes-an-14850|SilentAir]]). |
| 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|IOActive]], [[raw/proofpoint.com/proofpoint-fido-authentication-downgrade-4085|Proofpoint]]). |
| 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|Obsidian]]). Device-code and consent flows issue tokens with no MFA challenge to the attacker ([[Device Code Phishing]], [[OAuth Consent Phishing]]). |
At org level, attackers also target conditional-access gaps and social-engineer the help desk or the user (prompt bombing) ([[raw/bugcrowd.com/bugcrowd-how-attackers-bypass-multi-factor-authentication-part-1-3878|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-OTP` Basic-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 ([[raw/infosecwriteups.com/cve-2026-123002-how-i-found-a-2fa-bypass-in-gitea-and-wrote-the-patch-15308|writeup]]).
- **$12,000 2FA bypass**: a 3-digit OTP where a request parameter controlled rate-limit enforcement ([[raw/medium.com/the-12-000-2fa-bypass-so-simple-yet-so-critical-4361|writeup]]).
- **OTP login race**: a multi-step flow keyed on a `flowId`. Racing the email binding against OTP validation authenticated as another user ([[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|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 ([[raw/infosecwriteups.com/beyond-the-patch-understanding-the-sonicwall-ssl-vpn-mfa-bypass-exposu-9176|writeup]]).
- **SilentAir**: a state-level actor intercepted SMS and calls from inside Asian mobile operators by abusing SS7/Diameter `UpdateLocation` ([[raw/thehackernews.com/silentair-hijacks-asian-telecom-networks-to-intercept-sms-2fa-codes-an-14850|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 ([[raw/ioactive.com/ioactive-authentication-downgrade-mfa-bypass-4084|IOActive]]). Proofpoint spoofed a user agent that Entra doesn't offer FIDO to ([[raw/proofpoint.com/proofpoint-fido-authentication-downgrade-4085|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 ([[raw/infosecwriteups.com/cve-2026-123002-how-i-found-a-2fa-bypass-in-gitea-and-wrote-the-patch-15308|Gitea fix]]).
- Enforce MFA on every authentication path, including reset, API and legacy formats. Require re-authentication to change or disable factors ([[raw/cheatsheetseries.owasp.org/owasp-authentication-cheat-sheet-3897|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 ([[raw/ioactive.com/ioactive-authentication-downgrade-mfa-bypass-4084|IOActive]]).
- Reduce token-theft impact with device-bound credentials and token binding, short session lifetimes, and revocation on risk ([[raw/obsidiansecurity.com/token-based-attacks-how-attackers-bypass-mfa-4363|Obsidian]]).
- Retire SMS for high-value accounts ([[raw/thehackernews.com/silentair-hijacks-asian-telecom-networks-to-intercept-sms-2fa-codes-an-14850|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
- [[raw/portswigger.net/vulnerabilities-in-multi-factor-authentication-portswigger-4529|Vulnerabilities in multi-factor authentication (PortSwigger)]]
- [[raw/cobalt.io/bypassing-the-protections-mfa-bypass-techniques-4359|Bypassing the Protections: MFA Bypass Techniques]]
- [[raw/intigriti.com/broken-authentication-7-advanced-ways-of-bypassing-2-fa-intigriti-4528|Broken authentication: 7 Advanced ways of bypassing 2-FA (Intigriti)]]
- [[raw/github.com/bug-bounty-methodology-2fa-testing-4541|Bug-Bounty-Methodology: 2FA testing]]
- [[raw/deepstrike.io/two-factor-authentication-2fa-bypass-scenarios-deepstrike-4530|Two-Factor Authentication (2FA): Bypass Scenarios (DeepStrike)]]
- [[raw/infosecwriteups.com/cve-2026-123002-how-i-found-a-2fa-bypass-in-gitea-and-wrote-the-patch-15308|CVE-2026-123002: How I Found a 2FA Bypass in Gitea and Wrote the Patch]]
- [[raw/medium.com/the-12-000-2fa-bypass-so-simple-yet-so-critical-4361|The $12,000 2FA Bypass - So Simple, Yet So Critical]]
- [[raw/medium.com/race-condition-authentication-bypass-full-account-takeover-4362|Race Condition Authentication Bypass: Full Account Takeover]]
- [[raw/infosecwriteups.com/beyond-the-patch-understanding-the-sonicwall-ssl-vpn-mfa-bypass-exposu-9176|Beyond the Patch: Understanding the SonicWall SSL-VPN MFA Bypass Exposure]]
- [[raw/thehackernews.com/silentair-hijacks-asian-telecom-networks-to-intercept-sms-2fa-codes-an-14850|SilentAir Hijacks Asian Telecom Networks to Intercept SMS 2FA Codes and Spy on Taiwanese Users]]
- [[raw/ioactive.com/ioactive-authentication-downgrade-mfa-bypass-4084|IOActive: Authentication Downgrade / MFA Bypass]]
- [[raw/proofpoint.com/proofpoint-fido-authentication-downgrade-4085|Proofpoint: FIDO Authentication Downgrade]]
- [[raw/obsidiansecurity.com/token-based-attacks-how-attackers-bypass-mfa-4363|Token-Based Attacks: How Attackers Bypass MFA]]
- [[raw/bugcrowd.com/bugcrowd-how-attackers-bypass-multi-factor-authentication-part-1-3878|Bugcrowd: How attackers bypass multi-factor authentication (Part 1)]]
- [[raw/cheatsheetseries.owasp.org/owasp-authentication-cheat-sheet-3897|OWASP Authentication Cheat Sheet]]