mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 10:23:17 -05:00
SECURITY: email domain whitelist could be bypassed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user