Skip to content
Account takeover Write-up Intermediate

How I Logged in as Another User via Broken OAuth Identity Bindin

The application bound Google OAuth logins to the account's email address rather than Google's stable user identifier. After changing the account email, the original Google account could still log in and reach the account now holding the new email, allowing account takeover.

Digvijay Gholase Follow

Published on systemweakness.com

In this blog post, I’ll walk you through a real-world vulnerability I discovered while testing a web application’s OAuth implementation. The issue allowed me to log in as another user by abusing a broken identity binding mechanism after changing an account’s email.

Digvijay Gholase, on systemweakness.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application identified OAuth users by their mutable email address instead of the immutable subject identifier from the identity provider.

Impact

Anyone who previously had access to the linked Google account could still reach the account after its email was changed, resulting in authentication bypass and account takeover.

What the attacker needed

A Google account; ability to change the account email; access to the verification link

The fix

OAuth identities should be bound to the stable subject claim from the ID token, and critical changes such as an email update should invalidate prior sessions or force re-authentication.

How it was found

  1. Sign in with Google OAuth using the first email address.
  2. Change the account email to a second address from account settings.
  3. Confirm the change through the verification link sent to the new address.
  4. Log out of the application.
  5. Sign in again with Google OAuth using the original email address.
  6. Observe that the session lands in the account now holding the second email address.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you sign in with Google, the site should remember you by a permanent ID that Google gives it, not by your email address. Email addresses can be changed, so if the site matches you by email, someone who used to control that email can still get into the account after it has been moved to a new address. Here that let the tester reach an account that belonged to a different email.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by Digvijay Gholase

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.