mirror of
https://github.com/we-promise/sure.git
synced 2026-04-13 00:57:22 +00:00
&& will short circuit, vulnerable to potential timing attacks, use & instead (#1429)
This commit is contained in:
@@ -5,7 +5,7 @@ if Rails.env.production?
|
||||
configured_username = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_USERNAME", "sure"))
|
||||
configured_password = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_PASSWORD", "sure"))
|
||||
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), configured_username) &&
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), configured_username) &
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(password), configured_password)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user