Skip to content

Bind OIDC logins to (iss, sub), not email - #291

Open
jameshoweee wants to merge 1 commit into
sandbox-quantum:mainfrom
jameshoweee:security/oidc-identity-binding
Open

Bind OIDC logins to (iss, sub), not email#291
jameshoweee wants to merge 1 commit into
sandbox-quantum:mainfrom
jameshoweee:security/oidc-identity-binding

Conversation

@jameshoweee

Copy link
Copy Markdown

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 require email_verified. Legacy rows that stored only oidc_sub still match and get oidc_iss backfilled.

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.
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@jameshoweee

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@amaudruz

Copy link
Copy Markdown
Collaborator

recheck

1 similar comment
@jameshoweee

Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants