When OAuth Bypasses 2FA: Finding an Authentication Misconfiguration
An account that had TOTP-based two-factor authentication enabled could still be reached through the Google OAuth sign-in flow, which never asked for the authenticator code. Anyone who could authenticate with the linked Google account could therefore get into the application without passing the second factor the user had configured.
Published on medium.com
2fa Bypass
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Multi-factor authentication is meant to be a layer that holds even when the primary credential is compromised. The point of this finding is that enabling MFA does not guarantee that every authentication path enforces it.
During security research against target.com, the author found a two-factor authentication enforcement misconfiguration: an account that had Google Authenticator (TOTP) enabled could be reached through the Google OAuth login flow without completing the configured TOTP challenge. The Target team accepted it as a valid issue with Medium severity, and the author received a Certificate of Appreciation and a place in the Hall of Fame.
The two mechanisms involved do different jobs. TOTP generates short-lived verification codes from a shared secret and the current time, and applications commonly pair it with authenticator apps as an additional factor. Google OAuth sign-in delegates authentication to Google, so the user authenticates with their Google account instead of entering the application's own password. The security requirement that follows is that the application must enforce its own authentication policy consistently, whichever login method the user picks.
Setup
The testing was done with an account the researcher controlled. No specific tooling, versions or special preconditions are described beyond that: the account was created through Google OAuth, and TOTP was then enabled on it from the application's security settings.
Finding it
The researcher spends time on situations where the frontend says one thing and the backend behaves differently.

The observation that mattered was not that Google OAuth allowed authentication. It was that the application's own TOTP requirement was not enforced consistently across authentication methods. The account had a second factor configured, the application confirmed it was on, and yet a fresh session through Google OAuth reached the account without the code.
Exploitation
Step 1: Authenticate using Google
The researcher created an account using Google OAuth and confirmed normal access to the application.
Step 2: Enable TOTP-based 2FA
In the account's security settings, Google Authenticator was enabled. The setup process was completed and the application indicated that 2FA was enabled.
Step 3: Log out
After confirming the configuration, the researcher logged out to start a fresh authentication session.
Step 4: Authenticate through Google OAuth again
The same Google account was used to initiate another login.
Step 5: Observe the authentication behaviour
The application granted access to the account without requesting the configured TOTP code. That behaviour indicated that the Google OAuth flow was not enforcing the additional verification requirement configured inside the application.

Root cause
The report describes the flaw as improper enforcement of multi-factor authentication: the TOTP requirement was configured on the account but was not applied by the Google OAuth login flow. The report does not include code or describe the implementation.
The factor was genuinely configured and the application reported it as enabled; the gap was that the policy was not applied across login methods.
Impact
The issue allowed access through the Google OAuth flow without completing the application's configured TOTP challenge. The report frames the consequences as follows:
- Weakened account protection: the configured TOTP factor does not provide the intended additional verification in the affected login flow.
- Inconsistent security enforcement: different authentication methods apply different security requirements.
- Increased account-compromise risk: if an attacker can successfully authenticate through the affected flow, the missing TOTP challenge may remove an expected barrier to account access.
The impact depends on the application's authentication architecture and on the conditions under which an attacker can authenticate. The report is explicit about the limit: this is a bypass of the application's TOTP challenge, not a compromise of the user's Google account, and it did not by itself demonstrate a break of Google's authentication system.
Fix
The report does not describe the remediation that was applied. What it argues for is a centrally enforced authentication policy, so that the account's configured requirements apply regardless of which login method is used, rather than each flow deciding for itself whether to ask for the second factor.
Variants to test
Each of these is a check of the same underlying question: is the authentication policy applied once, centrally, or separately inside each flow?
What happened, in plain words
Imagine you lock your front door with two locks. The first lock is your normal key. The second lock is a special bolt you only open with a code from your phone. You feel safe because even if someone copies your key, they still need your phone to get in.
Now imagine the house also has a back door. The back door opens with the same key, but nobody ever installed the second bolt on it. Anyone with a copy of the key can walk in through the back door and never touch the second lock.
That is roughly what this report describes, but for a website. The website let people protect their account with a second step: after logging in, you also had to type a short code from an app on your phone. That second step is called two-factor authentication, or 2FA. The researcher found that if you logged in through a different door, the one labelled "Sign in with Google", the website let you straight in without ever asking for the code.
The website in the report is referred to as target.com. The security team behind it accepted the finding as a real problem of Medium severity, which is a middle level on the scale these teams use. The researcher also received a Certificate of Appreciation and a place in the Hall of Fame, which is a public list of people who have reported valid issues.
This article walks through the same ground as the technical write-up, but from zero. Every term is explained the first time it appears, and every step is explained with the reason behind it, not just the action.
The two pieces of technology involved
Before the finding makes sense, you need to know what the two login mechanisms are and why they are different.
What is TOTP?
TOTP stands for Time-based One-Time Password. It is the six-digit code that appears in apps like Google Authenticator and changes every thirty seconds or so.
Here is the everyday comparison. Think of a shared secret, a long random string of characters, that both your phone and the website know. Both sides also know the current time. They feed the secret and the time into a mathematical recipe, and out comes a short number. Because both sides use the same secret and roughly the same clock, they get the same number at the same moment. A minute later the time has changed, so the number changes too.
The important property is that the code is short-lived. Even if someone sees your code over your shoulder, it is useless a minute later. That is why it works as a second factor: it is something only you have, in your pocket, right now.
What is Google OAuth?
OAuth is a way for one website to let another website confirm who you are, without you handing your password to the second website. When you click "Sign in with Google", the application sends you to Google, Google asks you to log in (or you are already logged in there), and then Google tells the application "yes, this is the person who owns this Google account".
The everyday comparison is a members' club. Instead of the club checking your identity itself, it trusts a well-known bank that has already verified you. You show the bank's card, the club accepts it, and you are in. The club never sees your bank password.
In this case, the application delegates the job of checking who you are to Google. That is convenient, but it creates a question: if the application has its own extra security requirement, who makes sure that requirement is applied when you come in through Google?
Why the two must work together
The two mechanisms do different jobs:
- Google OAuth delegates authentication to Google. It answers the question "is this really the person who owns this Google account?"
- TOTP provides an additional verification factor configured within the application. It answers the question "can this person also produce the code that only the account owner should have?"
The security requirement that follows is simple to state: the application must enforce its own authentication policy consistently, whichever login method the user picks. If the policy says "accounts with TOTP enabled must present a TOTP code", that must be true whether you arrive by password or by Google.
How the researcher thinks about testing
The researcher describes a habit: spending time on situations where the frontend says one thing and the backend behaves differently.
Those two words need unpacking. The frontend is the part of the website you see and click: the pages, buttons and forms that your browser draws. The backend is the part on the server, out of sight, that actually decides things: whether to create a session, what data to return, whether a code is required.
A useful comparison is a restaurant. The menu (frontend) says the kitchen closes at ten. The kitchen (backend) might actually stop taking orders at nine. You only find out by ordering at half past nine.
Security bugs often live in that gap. The screen says "2FA is enabled", and it is telling the truth about the setting. But the server, when handling a particular login route, may simply never check that setting. The researcher describes this as a habit worth testing.

The image above sits where the researcher introduces this mindset: the frontend claiming one thing while the backend does another is the kind of boundary worth probing.
The vulnerability in one paragraph
The application allowed users to enable Google Authenticator-based TOTP 2FA on their accounts. However, the researcher discovered that the subsequent Google OAuth login flow did not enforce the configured TOTP challenge. As a result, an account with TOTP enabled could be accessed through the Google OAuth authentication flow without entering the configured authenticator code.
The report records the following details about the finding:
- Vulnerability type: Improper enforcement of multi-factor authentication
- Severity: Medium, as assigned by the program
- Status: Accepted
- Reward: Hall of fame plus a certificate of recognition
"Improper enforcement" is the key phrase. The feature existed. The setting was on. The problem was that one of the doors into the account did not check it.
How the researcher found it, step by step
The testing was done with an account the researcher controlled. That matters: you should never test on someone else's account. The report does not describe any special tools, versions or preconditions beyond that. The account was created through Google OAuth, and TOTP was then enabled on it from the application's security settings.
Step 1: Authenticate using Google
The researcher created an account using Google OAuth and confirmed that normal access to the application worked.
Why this step: before you can test whether a security setting is respected, you need a working account and a known-good baseline. If login through Google did not work at all, any later oddity would be ambiguous. Confirming normal access first means that anything strange later is a real difference, not a broken setup.
Step 2: Enable TOTP-based 2FA
The researcher went to the account's security settings and enabled Google Authenticator. The setup process was completed, and the application indicated that 2FA was enabled.
Why this step: this is the condition the whole test depends on. The account must genuinely have the second factor configured, and the application must genuinely acknowledge it. If the setting had silently failed, the later result would prove nothing. The researcher verified the acknowledgement before moving on.
Step 3: Log out
After confirming the configuration, the researcher logged out to begin a fresh authentication session.
Why this step: a session is the state of being logged in. When you log in, the server gives your browser a small piece of proof, usually stored as a cookie, which is a little file the browser keeps and sends back with every request. As long as that cookie is valid, the server treats you as logged in. If you test while still holding an old session, you might be seeing the old session's permissions rather than the result of a new login. Logging out forces the next login to go through the whole flow from scratch, which is the only way to see what that flow actually asks for.
Step 4: Authenticate through Google OAuth again
The same Google account was used to initiate another login.
Why this step: the test is specifically about the Google path. Using the same Google account keeps everything else constant, so the only variable is which door you came through.
Step 5: Observe the authentication behaviour
The application granted access to the account without requesting the configured TOTP code. That behaviour indicated that the Google OAuth flow was not enforcing the additional verification requirement configured inside the application.
Why this step matters: this is the observation. The account had a second factor configured, the application had confirmed it was on, and yet a fresh session through Google OAuth reached the account without the code.

The image above sits at the point of the observation: access was granted without the configured TOTP code being requested.
The finding was not simply that Google OAuth allowed authentication. The security concern was that the application's own TOTP requirement was not enforced consistently across authentication methods.
Why this is a security issue
Multi-factor authentication is designed to provide an additional layer of protection beyond the primary authentication mechanism. The primary mechanism is the first thing that proves who you are, such as a password or a Google login. The second factor is the extra proof.
When an application allows one authentication flow to bypass a configured second factor, the effective protection offered by that factor is weakened. "Bypass" here means getting past a check without satisfying it.
Consider an application that supports multiple authentication methods:
- Email and password
- Google OAuth
- Microsoft OAuth
- Passkeys
- Other identity providers
A passkey is a login method that uses your device's own security hardware, such as a fingerprint reader, instead of a typed password. An identity provider is a service that vouches for who you are, like Google or Microsoft in the list above.
If the application enforces MFA during password-based authentication but fails to enforce it during another supported login flow, its authentication policy becomes inconsistent. The security of the account then depends on the behaviour of the individual login flow rather than on a centrally enforced authentication policy.
"Centrally enforced" is the heart of it. Imagine a building where each door has its own guard, and each guard has their own idea of the rules. One guard checks badges, another waves everyone through. A central policy would be a single rulebook that every guard must follow. The report's argument is that the second-factor check should be that rulebook, applied once, rather than a decision each login path makes for itself.
What the impact could be
The impact depends on the application's authentication architecture and the conditions under which an attacker can authenticate. In this case, the identified issue allowed access through the Google OAuth flow without completing the application's configured TOTP challenge.
The report frames the potential consequences as follows:
- Weakened account protection: the configured TOTP factor does not provide the intended additional verification in the affected login flow.
- Inconsistent security enforcement: different authentication methods apply different security requirements.
- Increased account-compromise risk: if an attacker can successfully authenticate through the affected flow, the missing TOTP challenge may remove an expected barrier to account access.
"Account compromise" means someone else getting into your account. The point is not that this happened, but that a barrier the account owner believed was there was not, on that path.
It is important to distinguish bypassing an application's TOTP challenge from compromising the user's Google account. The finding concerned the application's failure to enforce its configured second factor. It did not, by itself, demonstrate a compromise of Google's authentication system. In plain terms: Google's door was not broken. The application's own extra lock was simply not fitted to one of its doors.
What the report says about the fix
The report does not describe the remediation that was applied. What it argues for is a centrally enforced authentication policy, so that the account's configured requirements apply regardless of which login method is used, rather than each flow deciding for itself whether to ask for the second factor.
In the building comparison: one rulebook, checked at every entrance, instead of each guard improvising.
Other places to look for the same pattern
Acknowledgment
The researcher thanks the security team for reviewing the report, validating the issue, and recognising the contribution to improving the application's security. The report was accepted as a Medium-severity vulnerability, and the researcher received a Certificate of Appreciation and recognition in the Hall of Fame.
Responsible disclosure, the practice of telling a company about a weakness privately and giving them time to fix it before it is made public, allows security researchers and developers to work together to identify weaknesses before they can be exploited maliciously.
Glossary
- 2FA (two-factor authentication): logging in with two separate proofs of identity, such as a password plus a code from your phone.
- MFA (multi-factor authentication): the general term for requiring more than one kind of proof to log in; 2FA is a common case of it.
- TOTP (Time-based One-Time Password): a short numeric code generated from a shared secret and the current time, changing every short interval.
- Google Authenticator: an app that stores the shared secret and displays TOTP codes.
- Shared secret: a long random value known to both your authenticator app and the website, used to generate matching codes.
- OAuth: a system where one service confirms your identity to another without sharing your password with it.
- Google OAuth: signing in to an application by proving you own a Google account, with Google doing the identity check.
- Identity provider: a service, such as Google or Microsoft, that vouches for who you are to other applications.
- SSO (single sign-on): logging in to many services using one identity.
- Passkey: a login method that uses your device's security hardware, such as a fingerprint reader, instead of a typed password.
- Frontend: the part of a website you see and interact with in your browser.
- Backend: the server-side part of a website that makes the real decisions and holds the data.
- Session: the state of being logged in, maintained by the server recognising your browser across requests.
- Cookie: a small piece of data your browser stores for a website and sends back with each request, often used to carry session proof.
- Authentication: the process of proving who you are.
- Authentication flow: a particular route through the login process, such as password login or Google login.
- Authentication policy: the rules an application applies about how users must prove who they are.
- Enforcement: actually applying a rule, rather than merely having it configured.
- Misconfiguration: a setting or design that is wrong or incomplete, leaving a gap.
- Improper enforcement of multi-factor authentication: the vulnerability type in this report, where an MFA requirement exists but is not applied on every login path.
- Bypass: getting past a security check without satisfying it.
- Challenge: a step that asks you to prove something, such as entering a TOTP code.
- Account compromise: someone other than the owner gaining access to an account.
- Severity: a rating of how serious a security issue is; this one was rated Medium by the program.
- Hall of Fame: a public list of researchers who have reported valid security issues to an organisation.
- Responsible disclosure: reporting a weakness privately to the organisation and allowing time to fix it before public discussion.
- Remediation: the fix applied to close a security issue.
- Stale: out of date, so that the system acts on an old picture of the state.
- target.com: the application named in the report as the place where the issue was found.