Skip to content

Commit b065b8c

Browse files
Copilothajekj
andcommitted
Use string.Equals for sync trigger key comparison
Co-authored-by: hajekj <8337913+hajekj@users.noreply.github.com> Agent-Logs-Url: https://github.com/NETWORG/github-organization-management/sessions/d25337a6-f18c-49cc-91bd-404a92ac89d1
1 parent b46045a commit b065b8c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Web/Controllers/SyncController.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Web.Services;
44
using Microsoft.AspNetCore.Mvc;
55
using Octokit;
6-
using System.Security.Cryptography;
76
using System.Text;
87

98
namespace Web.Controllers
@@ -40,9 +39,7 @@ public async Task<IActionResult> Index()
4039
return new UnauthorizedResult();
4140
}
4241

43-
if (!CryptographicOperations.FixedTimeEquals(
44-
Encoding.UTF8.GetBytes(providedKey.FirstOrDefault() ?? string.Empty),
45-
Encoding.UTF8.GetBytes(_syncTriggerKey)))
42+
if (!string.Equals(providedKey.FirstOrDefault(), _syncTriggerKey, StringComparison.Ordinal))
4643
{
4744
return new UnauthorizedResult();
4845
}

0 commit comments

Comments
 (0)