Skip to content
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

Prevent multiple emails separated by commas in email field #6018

Merged

Conversation

tsubery
Copy link
Contributor

@tsubery tsubery commented Dec 16, 2024

I know the conventional wisdom is there's no reason to over complicate email validation because it is implicitly validated by sending a confirmation email.
The current regex accepts multiple emails separated by commas or semicolons. For example:

  • email1@example.com,email2@example.com
  • email1@example.com;email2@example.com

Some email servers accept a comma or semicolon seperated list of emails as valid and would send the content to each recipient. For example, Mailgun. Documentation mentions you can use comma to separate multiple recipients. (I haven't tested it)

That means the implicit validation of the email is not enough. It could allows user with one email to sign up multiple times by using a suffix of random emails or enable abuse by submitting registrations with more than 20 emails at once.

@tsubery tsubery force-pushed the prevent-multiple-email-injection branch from cce9132 to a540aab Compare December 16, 2024 03:01
@josevalim josevalim merged commit 2cf42d6 into phoenixframework:main Dec 21, 2024
8 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

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