SECURITY: email domain whitelist could be bypassed

This commit is contained in:
Gerhard Schlager
2018-01-17 21:45:32 +01:00
parent 34ed6088b9
commit 2a22b90538
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class EmailValidator < ActiveModel::EachValidator
def self.email_in_restriction_setting?(setting, value)
domains = setting.gsub('.', '\.')
regexp = Regexp.new("@(.+\\.)?(#{domains})", true)
regexp = Regexp.new("@(.+\\.)?(#{domains})$", true)
value =~ regexp
end