Skip to content

Independent cybersecurity briefing

Latest

RSS
Breaches, bounties, zero-days, and AI.

Bug Bounty Write Ups

Google OAuth Account Takeover via Expired Domains

*AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.*

Adam Hale, ZeroDay Times editorBy Adam Hale3 min read

Still life for “Google OAuth Account Takeover via Expired Domains”: a magnifier and a sealed envelope, dark grove, Google mark, signal CASE. [ BUG BOUNTY ] badge.

AI-generated illustration

Dylan Ayrey bought one dead startup’s domain, then used Sign in with Google to open ex-staff Slack, Notion, Zoom and HR accounts

AI-assisted: drafted with AI help from public sources, then reviewed and edited. This is an analytical case study of a public disclosure, not my own discovery.

A startup shuts down and its domain expires. Someone else buys it, recreates the old staff email addresses, and clicks “Sign in with Google” on the SaaS tools the company used. That Google OAuth account takeover is what Dylan Ayrey of Truffle Security demonstrated in 2024, logging into ex-employees’ Slack, Notion, Zoom, ChatGPT and HR accounts. Google first marked it “won’t fix,” then reopened it and paid $1,337.

Disclaimer: * Educational and defensive use only. No domains, services or steps are named beyond what the researcher published.*

Vulnerability Overview

  • Type: Account takeover in apps that trust email and domain claims from Sign in with Google, after a domain changes owner
  • CWE (analytical mapping): CWE-287 (Improper Authentication), CWE-672 (Operation on a Resource after Expiration or Release)
  • CVE: None. This is a design issue across identity provider and relying parties
  • Bounty: $1,337 from Google’s vulnerability program, after the report was reopened

How the Google OAuth Account Takeover Worked (high level)

When you sign in with Google, the app receives claims about you. Two matter here: email and hd, the hosted Workspace domain. Many apps log users in, or let them join a company workspace, based on those two values alone.

Neither value proves continuity. If a new owner registers the old domain in Google Workspace and recreates an address, Google issues the same email and hd claims. The app sees no difference between the original employee and the buyer.

Ayrey bought one defunct domain and got in. The HR systems held tax documents, pay stubs, insurance details and Social Security numbers. He also notes a compounding effect: some tools list every workspace member, giving an attacker more names to recreate and more accounts to open.

He searched Crunchbase data and found more than 100,000 failed-startup domains for sale. Truffle’s own back-of-envelope estimate put potential exposure above 10 million accounts.

Business Impact

For relying parties, a login button is only as trustworthy as the identifier behind it. Former employees cannot protect accounts they no longer control, and founders often forget the SaaS tools left behind.

Google’s documented answer is the sub claim, a per-account identifier, and it updated its guidance to say email must not be used as a unique ID. Ayrey argues sub is unreliable in practice, citing an engineer who saw it change for a small share of logins; Google disputed that to reporters. Ayrey proposed two immutable claims, one for the user and one for the workspace. As of his January 2025 write-up, no platform fix had shipped.

Defending Against Google OAuth Account Takeover (my own analysis)

1. Key accounts on (issuer, sub). Treat email and hd as profile hints, never as the lookup key.

2. Never auto-merge on email. If a known email arrives with a different sub, route to recovery instead of logging in.

3. Don’t let dormant domains auto-join. Domain-based workspace joining should stop when the customer org is closed.

# Pseudocode: identity = (issuer, sub); email and hd are hints only
def on_google_login(claims):        # signature, iss, aud, exp already verified
    ident = (claims["iss"], claims["sub"])
    acct = accounts.by_identity(ident)
    if acct:
        return login(acct)
    acct = accounts.by_email(claims.get("email", ""))
    if acct and acct.identity and acct.identity != ident:
        audit("same_email_new_sub", acct.id)        # possible new domain owner
        return require_recovery(acct)               # never auto-merge
    if acct and acct.identity is None:
        return require_existing_login_to_link(acct) # one-time link, then store ident
    org = orgs.by_domain(claims.get("hd"))
    if org and org.status != "active":
        return deny("workspace_closed")             # no auto-join for dormant orgs
    return start_signup(ident, org)
# Test: same email and hd, new sub -> recovery flow, never the old account

Key Takeaways

  • An email address proves who controls a domain today, not who owned the account yesterday.
  • Relying parties own their account-linking logic; “the IdP said so” is not a design.
  • Offboarding a company includes its SaaS accounts and its domain.

Credit & Sources

Discovered and reported by Dylan Ayrey (Truffle Security). Primary source: Millions of Accounts Vulnerable due to Google’s OAuth Flaw, 13 January 2025. Corroboration: SC Media (Google’s statement and documentation update). Facts come from those sources; analysis and code are original.

Next breakdown: another real bug bounty case. Follow @masimshahzad for daily bug bounty breakdowns.

First published by Adam Hale on Medium.

Sources

Share

Corrections and tips:[email protected]