Repository navigation
fix(sso): refuse SSO callback user writes outside the provider's verified domain - #10060
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Critical impact] The PR appears safe to merge; the latest change fixes the previous foreign-email finding. SummaryThe PR checks an SSO provider’s verified domain before creating or changing a user’s email.
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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.
Summary
overrideUserInfoupdates) wrote whatever email the IdP asserted, and Sim's domain check in the admission after-hook ran only once the row was committeddatabaseHooks.user.create.before/update.beforenow refuse an SSO callback write unless the provider's domain is verified and the email belongs to it, so the row is never writtengetCurrentAdapter), and the refusal carriessso_provisioning_failedas bothmessageandcodeso create and update both redirect to the SSO pageisEmailInSSODomainin@sim/utils/sso-domainis shared with the admission use case so both checks use the same canonical comparisonType of Change
Testing
lib/auth/sso/callback-email-domain.integration.ts: real OIDC sign-in throughauth.handleragainst PostgreSQL with a local IdP — out-of-domain create refused (no user/account), in-domain create still succeeds,overrideUserInfocannot rewrite a linked user's emailcodeeach fails its testadmit-sso-user,lifecycle-audit,provider-concurrency,primary-providerlib/auth,app/api/auth,ee/sso(733 tests),packages/utilssso-domaincheck:comment-hygiene,file-names,source-conventions,test-patterns,utils,boundaries,explicit-any,source-textChecklist
test-auditauthoring gate)