Hello,
I have some security concerns regarding the default value of 3 minutes for time-step. It seems very long.
|
private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3); |
In addition allowing variance of two steps ahead and behind make the window even larger.
|
// Allow a variance of no greater than 9 minutes in either direction |
|
var currentTimeStep = GetCurrentTimeStepNumber(); |
|
using (var hashAlgorithm = new HMACSHA1(securityToken)) |
|
{ |
|
for (var i = -2; i <= 2; i++) |
|
{ |
|
var computedTotp = ComputeTotp(hashAlgorithm, (ulong)((long)currentTimeStep + i), modifier); |
|
if (computedTotp == code) |
|
{ |
|
return true; |
|
} |
|
} |
|
} |
RFC recommends a time-step size of 30 seconds and a time-step window of less than 10 minutes.
Hello,
I have some security concerns regarding the default value of 3 minutes for time-step. It seems very long.
aspnetcore/src/Identity/Extensions.Core/src/Rfc6238AuthenticationService.cs
Line 14 in ce16ff0
In addition allowing variance of two steps ahead and behind make the window even larger.
aspnetcore/src/Identity/Extensions.Core/src/Rfc6238AuthenticationService.cs
Lines 101 to 113 in ce16ff0
RFC recommends a time-step size of 30 seconds and a time-step window of less than 10 minutes.