You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the following configuration:
selfservice:
methods:
code:
mfa_enabled: true
flows:
settings:
required_aal: highest_available
A user who normally requires MFA to access settings ( has available_aal = aal2) can bypass the AAL2 requirement by using email OTP for both factors:
Start account recovery → receive an email OTP (recovery code) as the first factor.
Authenticate with that email OTP.
When prompted for MFA, use another email OTP (mfa email code) as the second factor.
Access the settings flow without providing a distinct second factor.
Questions
Is this expected behavior in Kratos when highest_available is used?
How can we prevent the same factor from being used twice to meet the AAL2 requirement?
Should Kratos enforce a distinct second factor for AAL2?
Reproducing the bug
(A user who normally requires MFA to access settings ( has available_aal = aal2))
Start account recovery → receive an email OTP (recovery code) as the first factor.
Authenticate with that email OTP.
When prompted for MFA, use another email OTP (mfa email code) as the second factor.
Access the settings flow without providing a distinct second factor.
It appears this is happening because code will provide aal2 when configured with mfa_enabled. code is also one of the options for account recovery; this provides aal1 with the method: code_recovery. The system marks these as distinct methods (or factors) and does not treat them as the same factor of authentication. One possible fix for this will require that if recovery via email is enabled, some other backup MFA must be enforced (e.g., lookup_code) so the MFA options available after account recovery include something other than technically the same option used to gain aal1.
Preflight checklist
Ory Network Project
No response
Describe the bug
With the following configuration:
selfservice:
methods:
code:
mfa_enabled: true
flows:
settings:
required_aal: highest_available
A user who normally requires MFA to access settings ( has available_aal = aal2) can bypass the AAL2 requirement by using email OTP for both factors:
Start account recovery → receive an email OTP (recovery code) as the first factor.
Authenticate with that email OTP.
When prompted for MFA, use another email OTP (mfa email code) as the second factor.
Access the settings flow without providing a distinct second factor.
Questions
Is this expected behavior in Kratos when highest_available is used?
How can we prevent the same factor from being used twice to meet the AAL2 requirement?
Should Kratos enforce a distinct second factor for AAL2?
Reproducing the bug
(A user who normally requires MFA to access settings ( has available_aal = aal2))
Start account recovery → receive an email OTP (recovery code) as the first factor.
Authenticate with that email OTP.
When prompted for MFA, use another email OTP (mfa email code) as the second factor.
Access the settings flow without providing a distinct second factor.
Relevant log output
Relevant configuration
Version
v1.3.1
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
No response
The text was updated successfully, but these errors were encountered: