mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 04:56:18 +08:00
SECURITY: Sanitize email id for use as mutex key
This commit is contained in:
parent
1d38bf7e2c
commit
b3e5f7a8c6
|
@ -67,7 +67,8 @@ module Email
|
||||||
|
|
||||||
def process!
|
def process!
|
||||||
return if is_blacklisted?
|
return if is_blacklisted?
|
||||||
DistributedMutex.synchronize(@message_id) do
|
id_hash = Digest::SHA1.hexdigest(@message_id)
|
||||||
|
DistributedMutex.synchronize("process_email_#{id_hash}") do
|
||||||
begin
|
begin
|
||||||
return if IncomingEmail.exists?(message_id: @message_id)
|
return if IncomingEmail.exists?(message_id: @message_id)
|
||||||
ensure_valid_address_lists
|
ensure_valid_address_lists
|
||||||
|
|
Loading…
Reference in New Issue
Block a user