Skip to content

Prevent user from bypassing domain signup restrictions

Serena Fang requested to merge user-change-email-non-allowlist-domain into master

What does this MR do and why?

Describe in detail what your merge request does and why.

https://gitlab.com/gitlab-org/gitlab/-/issues/19337

Currently, a user can bypass the domain allowlist by creating an account with an email that is on the list, then changing their email to a domain that is not on the list. Similarly, they can create an account with a valid email, then update their profile to a domain that is on the denylist. They can also change their email to a restricted domain.

This MR checks the domain restrictions when a user changes their email. If the email domain is not valid, prevent the change and show the user an error:

image

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Admin > Settings > Sign-up restrictions > Allowed domains for sign-ups > allowed.com
  2. Sign out, then register a new user user@allowed.com
  3. Sign in as user@allowed.com, then Edit profile > Email > user@notallowed.com
  4. Email is not valid. Please check with your administrator.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Serena Fang

Merge request reports

Loading