mirror of
https://github.com/bitwarden/server
synced 2026-01-09 03:53:42 +00:00
use fixed-time comparison of secrets (#1698)
This commit is contained in:
@@ -14,6 +14,7 @@ using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Billing.Controllers
|
||||
{
|
||||
@@ -57,7 +58,7 @@ namespace Bit.Billing.Controllers
|
||||
|
||||
var key = HttpContext.Request.Query.ContainsKey("key") ?
|
||||
HttpContext.Request.Query["key"].ToString() : null;
|
||||
if (key != _billingSettings.FreshdeskWebhookKey)
|
||||
if (!CoreHelpers.FixedTimeEquals(key, _billingSettings.FreshdeskWebhookKey))
|
||||
{
|
||||
return new BadRequestResult();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user