-
Notifications
You must be signed in to change notification settings - Fork 51.4k
feat: Prevent ldap email based account when there are deplicate emails #21745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Prevent ldap email based account when there are deplicate emails #21745
Conversation
BundleMonUnchanged files (2)
No change in files bundle size Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 7 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/cli/src/ldap.ee/__tests__/ldap.service.test.ts">
<violation number="1" location="packages/cli/src/ldap.ee/__tests__/ldap.service.test.ts:1446">
This assertion is inverted: with an existing LDAP auth identity, handleLdapLogin should bypass duplicate-email blocking and return the user, but the test still expects undefined because getAuthIdentityByLdapId stays mocked to null. Update the test to mock an existing identity and expect the login to succeed.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
E2E Tests: n8n tests passed after 6m 49.8s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
|
Got released with |
Summary
Prevent account take over and privilege escalation via attacker changing LDAP email to match victims account.
This is done by preventing auto-linking of account when the LDAP records has multiple users with the same email
Related Linear tickets, Github issues, and Community forum posts
Resolves PAY-4089
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)Note
Adds
enforceEmailUniquenessto LDAP config (default true) and blocks LDAP login when multiple directory entries share the same email; exposes toggle in settings UI and updates tests.enforceEmailUniqueness: booleantoLdapConfigwith secure defaulting inloadConfig()andLDAP_DEFAULT_CONFIGURATION.hasEmailDuplicatesInLdap()and enforce inhandleLdapLogin()to block auto-linking when duplicates detected.ldap.ee/constants.ts) and non-sensitive config list to includeenforceEmailUniqueness.LdapConfigto includeenforceEmailUniqueness.enforceEmailUniquenessinSettingsLdapView.vuewith i18n strings, and persist viaupdateLdapConfig().Written by Cursor Bugbot for commit 8cf9f0b. This will update automatically on new commits. Configure here.