fix: remove allowDangerousEmailAccountLinking (pre-registration account linking) - #377
Open
vedant7007 wants to merge 1 commit into
Open
Conversation
The flag let a Google sign-in link to a pre-existing credentials account with the same email, so an attacker could POST /api/auth/signup with a victim's email first and have the victim's later Google login link to the attacker-created (attacker-password) row. Drop the flag (defaults to false) so NextAuth won't auto-link across providers by unverified email. Fixes TravellersMeet#370
|
Thanks for opening this PR, @vedant7007! 👋 Our maintainers will review it shortly. Estimate Time is 5-8 hrs .Meanwhile please:
If anything changes, feel free to push updates—this thread will stay open. |
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #370
Problem
src/lib/auth.tssetallowDangerousEmailAccountLinking: trueon the Google provider. An attacker couldPOST /api/auth/signupwith a victims email before the victim first uses Google sign-in, creating a credentials user row with the attackers password. When the victim later signs in with Google for that email, the flag links the Google identity to the attacker-created row instead of refusing — the account then carries the attackers credentials alongside the victims OAuth login.Fix
Remove the flag (defaults to
false), so NextAuth will not auto-link a provider to an existing account by (unverified) email.Testing
npx tsc --noEmitclean on the changed file.Contributing as part of Elite Coders Summer of Code (ECSoC 2026).