GHSA-29rf-f4vv-pvq6 Authorizer: Zero-click account takeover via OAuth identity linking to unverified email accounts
The OAuth callback handler links incoming OAuth identities (Google, GitHub, etc.) to existing accounts matched by email address without verifying that the existing account's email was verified by its original owner. An attacker who pre-registers with a victim's email address (without verifying it) gains persistent password-based access to the victim's account after the victim completes a normal OAuth login. Verified against HEAD (commit 73679fa).Root CauseIn `internal/http_handlers/oauth_callback.go`, when an OAuth login occurs for an email that already exists in the database:Line 125: The existing user is looked up by email:Line 164: The OAuth user object is replaced with the existing user:Lines 173-176: The OAuth provider is appended to the existing user's signup methods:Lines 179-181: If the existing account's email was NOT verified, it is automatically verified:Line 219: The merged user is saved to the database:At no point is the existing account's password invalidated or the owner notified that a new OAuth identity was linked.Attack ChainAttacker signs up with `victim@company.com` using email/password. Attacker sets a known password but does NOT click the email verification link. The account exists in the database with `EmailVerifiedAt = nil`.Some time later, the real owner of `victim@company.com` logs in via Google OAuth (a completely normal action).The OAuth callback at line 125 finds the attacker's existing account by email.At line 164, the Google OAuth identity is linked to the attacker's account.At line 179-181, the email is automatically verified (the attacker never verified it, but now it's marked as verified).At line 175, "google" is appended to the signup methods. The account now has both "basic_auth" and "google" as valid login methods.The attacker's original password is still valid in the database. It was never cleared, changed, or invalidated.The attacker logs in with `victim@company.com` and the password they originally set. They now have full access to the victim's account, including any data the victim added via their Google session.Why This Is Zero-ClickThe victim performs no unusual action. They simply log in via their Google account, which is the expected, secure behavior. The attacker staged the account beforehand and gains access without any further interaction.This is a classic Account Linking vulnerability (cited in OWASP authentication guidelines). The core logic flaw is a trust boundary violation. Authorizer correctly trusts that Google has verified the email address, but it incorrectly extends that trust to validate the password that was set by the unverified attacker. The attacker maintains persistent, password-based backdoor access to the victim's account, even if the victim later revokes Authorizer's OAuth access from their Google account settings. The password was set before Google was ever involved and is never invalidated by the linking process.ImpactFull account takeover for any user who logs in via OAuthAttacker maintains persistent password-based access even after the victim changes OAuth providersAll data the victim creates after OAuth login is accessible to the attackerThe victim has no indication their account was pre-stagedAffects every OAuth provider configured in Authorizer (Google, GitHub, Facebook, Apple, LinkedIn, Twitter, Discord, Twitch, Roblox, Microsoft)Suggested FixBefore linking an OAuth identity to an existing account, verify that the existing account's email is already verified:Additionally, when linking a new OAuth identity, invalidate any existing password on the account or require the user to re-authenticate via the original method.CreditKoda Reef
CVSS v4.0 score: 8.7