mirror of
https://github.com/bitwarden/server.git
synced 2025-07-18 16:11:28 -05:00
use fixed-time comparison of secrets (#1698)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Bit.Core;
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
@ -34,7 +35,7 @@ namespace Bit.Billing.Controllers
|
||||
|
||||
var key = HttpContext.Request.Query.ContainsKey("key") ?
|
||||
HttpContext.Request.Query["key"].ToString() : null;
|
||||
if (key != _billingSettings.AppleWebhookKey)
|
||||
if (!CoreHelpers.FixedTimeEquals(key, _billingSettings.AppleWebhookKey))
|
||||
{
|
||||
return new BadRequestResult();
|
||||
}
|
||||
|
Reference in New Issue
Block a user