high-dawn-87261
02/21/2025, 8:56 AMselfservice:
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:
1. Start account recovery → receive an email OTP (recovery code) as the first factor.
2. Authenticate with that email OTP.
3. When prompted for MFA, use another email OTP (mfa email code) as the second factor.
4. 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?
(edited)flaky-kilobyte-10585
02/21/2025, 9:50 AMbrief-egg-61061
02/21/2025, 9:50 AMbrief-egg-61061
02/21/2025, 9:50 AMhigh-dawn-87261
07/08/2025, 2:27 PMselfservice:
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:
1. Start account recovery → receive an email OTP (recovery code) as the first factor.
2. Authenticate with that email OTP.
3. When prompted for MFA, use another email OTP (mfa email code) as the second factor.
4. 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?brief-egg-61061
07/08/2025, 2:27 PMbrief-egg-61061
07/08/2025, 2:27 PMhighest_available
is used? According to a [GitHub issue](https://github.com/ory/kratos/issues/4317), this behavior is currently possible in Ory Kratos. The system treats the recovery code (email OTP used for account recovery) and the MFA email code (email OTP used for step-up authentication) as distinct authentication methods, even though both are delivered via email. As a result, a user can satisfy the AAL2 requirement by using two email OTPs, which may not be the intended security posture. > "The system marks these as distinct methods (or factors) and does not treat them as the same factor of authentication." > — [Bypassing AAL2 in Settings Flow Using Email OTP for Both Factors](https://github.com/ory/kratos/issues/4317) --- ### 2. How can we prevent the same factor from being used twice to meet the AAL2 requirement? The knowledge sources do not provide a direct configuration option to prevent this scenario. However, a comment in the referenced issue suggests a possible workaround: require that, if recovery via email is enabled, another backup MFA method (such as lookup codes or TOTP) must also be enforced. This ensures that after account recovery, the user must use a different method for MFA, not just another email OTP. > "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." > — [Bypassing AAL2 in Settings Flow Using Email OTP for Both Factors](https://github.com/ory/kratos/issues/4317) --- ### 3. Should Kratos enforce a distinct second factor for AAL2? The knowledge sources do not explicitly state whether Kratos should enforce a distinct second factor for AAL2. However, the issue highlights that, as of now, Kratos does not enforce this distinction when both factors are delivered via the same channel (email OTP). The discussion suggests that enforcing distinct factors would be a desirable security improvement, but this is not currently implemented by default. --- Summary: - The described behavior is possible and currently expected in Kratos with the given configuration. - To prevent it, you should require users to configure a backup MFA method that is distinct from the recovery method. - Kratos does not currently enforce distinct factors for AAL2, but this is recognized as a potential area for improvement. If you need strict enforcement of distinct factors, you may need to implement additional checks or policies outside of Kratos until this is addressed in the product itself. [Bypassing AAL2 in Settings Flow Using Email OTP for Both Factors](https://github.com/ory/kratos/issues/4317)high-dawn-87261
07/08/2025, 2:31 PMbrief-egg-61061
07/08/2025, 2:31 PMbrief-egg-61061
07/08/2025, 2:31 PM