Skip to content

Allow Rfc6238AuthenticationService time-step size and time-step window to be configurable #27088

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-very-fewThis issue impacts very few customersarea-identityIncludes: Identity and providersenhancementThis issue represents an ask for new feature or an enhancement to an existing oneseverity-majorThis label is used by an internal tooltriaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions