Bind OIDC logins to (iss, sub), not email - #291
Open
jameshoweee wants to merge 1 commit into
Open
Conversation
OIDC login matched users by email and never checked email_verified, so a token bearing an existing user's email (e.g. the seeded admin) logged in as that user with their role: account/admin takeover on any IdP that lets a subject set an arbitrary or unverified email. Match on the immutable (iss, sub); refuse an email that already belongs to a different account instead of linking it; require email_verified. Legacy rows (sub only) still match and get iss backfilled. Updates and adds tests.
jameshoweee
requested review from
amaudruz and
christian-mcdermott
as code owners
August 25, 2026 15:47
|
All contributors have signed the CLA. ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Collaborator
|
recheck |
1 similar comment
Author
|
recheck |
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.
OIDC login matched users by email and never checked
email_verified, so a token carrying an existing user's email (e.g. the seeded admin) logged in as that user with their role. Account/admin takeover on any IdP that lets a subject set an arbitrary or unverified email.Fix: match on the immutable
(iss, sub), refuse an email that already belongs to a different account instead of linking it, and requireemail_verified. Legacy rows that stored onlyoidc_substill match and getoidc_issbackfilled.