Skip to content
OAuth / SSO Write-up Beginner

How I found the Authentication Bypass bug and Earn $$$$

The OAuth login flow did not properly invalidate the session or access token after the user signed out of both the application and Google, so signing in again via OAuth would automatically log the user back into the account without re-authentication. An attacker with access to the victim's device could then access the victim's account.

Thedarkwayg Follow

Published on medium.com

Bounty$1,000 View original

Thedarkwayg

Thedarkwayg, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is an application that specialises in online news, media and entertainment. The feature in question is the login flow. The application offers two ways to sign in:

  1. Login via OAuth
  2. Login with Email
Photos are for illustrative purposes From the original on medium.com

The write-up focuses on the OAuth path, specifically signing in with Google. In a normal OAuth sign-in, the user authenticates with their Google account and is then redirected to their account on the target site (referred to in the report as redacted.com).

The researcher describes the behaviour that caught their attention: after signing in with Google, they are redirected to the redacted.com account. If they then log out at redacted.com but do not sign out of Google, and log back in to redacted.com using Google, they are automatically redirected to the redacted.com account. The researcher notes this is often a misconfiguration, because when signed in with Google, users will often be given a choice of the Google account they want to use instead of being redirected directly to redacted.com.

Photos are for illustrative purposes From the original on medium.com

Even after signing out of everything, including the Google account, the researcher reports that they can still sign in to redacted.com with Google.

Setup

The report does not describe any special tooling, versions or test accounts. The precondition is a redacted.com account that can be accessed through Google OAuth, plus a Google account used for that sign-in. The researcher's own account is used throughout.

Finding it

The observation is behavioural rather than request-level. The researcher noticed that the OAuth sign-in did not require a fresh authentication step in the way they expected. Two things stood out:

  • Logging out of redacted.com while remaining signed in to Google, then signing in again via Google, went straight back into the redacted.com account.
  • Even after signing out of everything, including the Google account, signing in again via OAuth still gave direct access to the account without authentication.

The second point is the one that looked wrong: a full sign-out, including the identity provider, should not leave a path that lands the user back inside the application without authenticating again.

Exploitation

Step 1: Sign in via OAuth

Log in to redacted.com through the OAuth option and choose Google. Complete the steps to authenticate the Google account. The application redirects to the redacted.com account.

Step 2: Sign out of everything

Sign out of redacted.com and also sign out of the Google account. The report's exploit sequence describes this as signing out all, including the Google account.

Step 3: Sign in again via OAuth

Start the OAuth login again. According to the report, this gives direct access to the account without authentication.

The researcher's own summary of the sequence:

Now I will login via Oauth -> Google -> Complete the steps to authenticate -> Sign out all including Googleaccount -> Sign in again via Oauth -> Direct access to the account without authentication

No HTTP requests, responses, headers or parameters are shown in the report, so the exact OAuth exchange cannot be reproduced from it.

The attack scenario

The researcher frames the practical attack as follows:

Victim logs into redacted.com account via Google on public computer => Moments later, victim leaves their computer (despite being signed out of redacted.com andGoogleaccount) => At this point, anyone can access the victim’s account using Google.

In other words, the victim signs in on a shared or public machine, signs out of both the application and Google, and walks away. Anyone who then uses the OAuth login on that machine can reach the victim's account.

Root cause

The report gives two possible causes:

  • Access token/code is not cancelled
  • Auto login

When attacker login with Google => Access token/code will be called by redacted.com and automatically login to the account

The report lists two possible causes, an access token or code that is not cancelled, and auto login, without establishing which applies. The report does not show the server-side code, so which of the two cases applies, and where exactly the token or code survives, is not established in the text.

Impact

An attacker with access to a device where the victim previously signed in via Google can reach the victim's redacted.com account, even after the victim has signed out of both redacted.com and Google. The report's scenario is a public computer the victim leaves behind.

The severity of the bug was reduced because, in the program's words, "the attacker needs access to the victim’s device".

Fix

The report gives no fix. A reasonable mitigation would be to invalidate the token or code on sign-out.

Variants to test

  • Sign out of the application only, keep the identity provider session, and start OAuth again. A positive result is landing in the account without a fresh authentication prompt.
  • Sign out of both the application and the identity provider, then start OAuth again. A positive result is the same direct access the researcher describes.
  • Repeat the flow on a second browser profile or a fresh private window on the same machine, to see whether the surviving state is tied to the browser or to the server-side session.
  • Try the same sequence with other OAuth providers offered by a target, since the report only covers Google.
  • Check whether the application gives the user an account chooser on the identity provider side. If it redirects straight back without one, that matches the misconfiguration the researcher describes.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

What happened, in plain words

A security researcher found a way to get back into a website account without proving who you are, even after you have signed out. The website is a news, media and entertainment site. It lets you sign in either with your email or with your Google account. The researcher noticed that if you sign in with Google, then sign out of the website but not out of Google, and then sign in with Google again, you go straight back into the website account. Even if you sign out of Google too, the same thing happens: you can still get straight back into the website account. This is called an authentication bypass, because you bypass (skip) the normal authentication (proving who you are) step.

The researcher reported this to the bug bounty program on HackerOne. The severity was reduced because, in the program's words, "the attacker needs access to the victim’s device".

Context

The target is an application that specialises in online news, media and entertainment. The feature in question is the login flow. The application offers two ways to sign in:

  1. Login via OAuth
  2. Login with Email
Photos are for illustrative purposes From the original on medium.com

OAuth is a way for a website to let you sign in using another service, like Google, without giving the website your Google password. It works like a valet key for your car: you give a special key that only allows the valet to drive the car, not open the trunk or keep it. In OAuth, the website gets a token (a digital key) from Google that proves you signed in, and it can use that token to access your account on the website.

The write-up focuses on the OAuth path, specifically signing in with Google. In a normal OAuth sign-in, the user authenticates with their Google account and is then redirected to their account on the target site (referred to in the report as redacted.com).

The researcher describes the behaviour that caught their attention: after signing in with Google, they are redirected to the redacted.com account. If they then log out at redacted.com but do not sign out of Google, and log back in to redacted.com using Google, they are automatically redirected to the redacted.com account. The researcher notes this is often a misconfiguration, because when signed in with Google, users will often be given a choice of the Google account they want to use instead of being redirected directly to redacted.com.

Photos are for illustrative purposes From the original on medium.com

Even after signing out of everything, including the Google account, the researcher reports that they can still sign in to redacted.com with Google.

Setup

The report does not describe any special tooling, versions or test accounts. The precondition is a redacted.com account that can be accessed through Google OAuth, plus a Google account used for that sign-in. The researcher's own account is used throughout.

Finding it

The observation is behavioural rather than request-level. The researcher noticed that the OAuth sign-in did not require a fresh authentication step in the way they expected. Two things stood out:

  • Logging out of redacted.com while remaining signed in to Google, then signing in again via Google, went straight back into the redacted.com account.
  • Even after signing out of everything, including the Google account, signing in again via OAuth still gave direct access to the account without authentication.

The second point is the one that looked wrong: a full sign-out, including the identity provider, should not leave a path that lands the user back inside the application without authenticating again. The identity provider is the service that confirms who you are, in this case Google.

Exploitation

Step 1: Sign in via OAuth

Log in to redacted.com through the OAuth option and choose Google. Complete the steps to authenticate the Google account. The application redirects to the redacted.com account.

Step 2: Sign out of everything

Sign out of redacted.com and also sign out of the Google account. The report's exploit sequence describes this as signing out all, including the Google account.

Step 3: Sign in again via OAuth

Start the OAuth login again. According to the report, this gives direct access to the account without authentication.

The researcher's own summary of the sequence:

Now I will login via Oauth -> Google -> Complete the steps to authenticate -> Sign out all including Googleaccount -> Sign in again via Oauth -> Direct access to the account without authentication

No HTTP requests, responses, headers or parameters are shown in the report, so the exact OAuth exchange cannot be reproduced from it.

The attack scenario

The researcher frames the practical attack as follows:

Victim logs into redacted.com account via Google on public computer => Moments later, victim leaves their computer (despite being signed out of redacted.com andGoogleaccount) => At this point, anyone can access the victim’s account using Google.

In other words, the victim signs in on a shared or public machine, signs out of both the application and Google, and walks away. Anyone who then uses the OAuth login on that machine can reach the victim's account.

Root cause

The report gives two possible causes:

  • Access token/code is not cancelled
  • Auto login

When attacker login with Google => Access token/code will be called by redacted.com and automatically login to the account

The report lists two possible causes, an access token or code that is not cancelled, and auto login, without establishing which applies. The report does not show the server-side code, so which of the two cases applies, and where exactly the token or code survives, is not established in the text.

Impact

An attacker with access to a device where the victim previously signed in via Google can reach the victim's redacted.com account, even after the victim has signed out of both redacted.com and Google. The report's scenario is a public computer the victim leaves behind.

The severity of the bug was reduced because, in the program's words, "the attacker needs access to the victim’s device".

Fix

The report gives no fix. A reasonable mitigation would be to invalidate the token or code on sign-out.

Variants to test

  • Sign out of the application only, keep the identity provider session, and start OAuth again. A positive result is landing in the account without a fresh authentication prompt.
  • Sign out of both the application and the identity provider, then start OAuth again. A positive result is the same direct access the researcher describes.
  • Repeat the flow on a second browser profile or a fresh private window on the same machine, to see whether the surviving state is tied to the browser or to the server-side session.
  • Try the same sequence with other OAuth providers offered by a target, since the report only covers Google.
  • Check whether the application gives the user an account chooser on the identity provider side. If it redirects straight back without one, that matches the misconfiguration the researcher describes.

Glossary

  • OAuth: an open standard for access delegation, commonly used as a way for websites to let users sign in with an account from another service (like Google) without sharing their password.
  • Authentication: the process of verifying a user's identity, typically by checking credentials like a username and password.
  • Authentication bypass: a vulnerability where an attacker can access an account or system without going through the normal authentication process.
  • Token: a piece of data that represents a user's authenticated session or permission, often used in OAuth to grant access to resources.
  • Access token: a credential that grants access to protected resources, typically issued by an OAuth provider after successful authentication.
  • Code: in OAuth, an authorization code is a short-lived token that the client exchanges for an access token.
  • Identity provider: a service that authenticates users and provides their identity information to other services, such as Google.
  • Misconfiguration: a setting or configuration that is incorrect or insecure, often leading to vulnerabilities.
  • Bug bounty program: a program where organisations reward security researchers for finding and reporting vulnerabilities in their systems.
  • HackerOne: a platform that connects organisations with security researchers and manages bug bounty programs.
  • Severity: a measure of the potential impact of a vulnerability, often used to prioritise fixes.
  • CVSS: Common Vulnerability Scoring System, a standardised way to rate the severity of security vulnerabilities.
  • Session: a period of interaction between a user and a system, often maintained using cookies or tokens.
  • Cookie: a small piece of data stored by a website in a user's browser to remember state, such as login status.
  • Redirect: the process of sending a user from one URL to another, often used in OAuth flows to return the user to the application after authentication.
  • Public computer: a computer accessible to multiple people, such as one in a library or internet cafe, where security risks are higher.
  • Invalidate: to make something no longer valid, such as revoking a token so it cannot be used again.
  • Replay: an attack where a valid data transmission is maliciously or fraudulently repeated or delayed.
  • Browser profile: a set of settings, cookies, and other data associated with a specific user in a browser, allowing multiple users to use the same browser separately.
  • Private window: a browser mode that does not save browsing history, cookies, or other data locally, often used for privacy.
  • Server-side session: a session managed and stored on the server, as opposed to client-side (in the browser).
  • Account chooser: a feature in some identity providers that lets the user select which account to use when multiple accounts are signed in.

More by Thedarkwayg

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.