{"id":"CVE-2024-45042","aliases":["CVE-2024-45042","GHSA-wc43-73w7-x2f5","GO-2024-3160"],"related":[],"kind":"vulnerability","state":"published","title":"Ory Kratos's `highest_available` setting does not properly respect code + mfa credentials","summary":"Ory Kratos is an identity, user management and authentication system for cloud services. Prior to version 1.3.0, given a number of preconditions, the `highest_available` setting will incorrectly assume that the identity’s highest available AAL is `aal1` even though it really is `aal2`. This means that the `highest_available` configuration will act as if the user has only one factor set up, for that particular user. This means that they can call the settings and whoami endpoint without a `aal2` session, even though that should be disallowed. An attacker would need to steal or guess a valid login OTP of a user who has only OTP for login enabled and who has an incorrect `available_aal` value stored, to exploit this vulnerability. All other aspects of the session (e.g. the session’s aal) are not impacted by this issue. On the Ory Network, only 0.00066% of registered users were affected by this issue, and most of those users appeared to be test users. Their respective AAL values have since been updated and they are no longer vulnerable to this attack. Version 1.3.0 is not affected by this issue. As a workaround, those who require MFA should disable the passwordless code login method. If that is not possible, check the sessions `aal` to identify if the user has `aal1` or `aal2`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Ory Kratos is an identity, user management and authentication system for cloud services. Prior to version 1.3.0, given a number of preconditions, the `highest_available` setting will incorrectly assume that the identity’s highest available AAL is `aal1` even though it really is `aal2`. This means that the `highest_available` configuration will act as if the user has only one factor set up, for that particular user. This means that they can call the settings and whoami endpoint without a `aal2` session, even though that should be disallowed. An attacker would need to steal or guess a valid login OTP of a user who has only OTP for login enabled and who has an incorrect `available_aal` value stored, to exploit this vulnerability. All other aspects of the session (e.g. the session’s aal) are not impacted by this issue. On the Ory Network, only 0.00066% of registered users were affected by this issue, and most of those users appeared to be test users. Their respective AAL values have since been updated and they are no longer vulnerable to this attack. Version 1.3.0 is not affected by this issue. As a workaround, those who require MFA should disable the passwordless code login method. If that is not possible, check the sessions `aal` to identify if the user has `aal1` or `aal2`.","source":"cvelist"},{"lang":"en","text":"## Preconditions\n\n- The `code` login method is enabled with the `passwordless_enabled` flag set to `true` .\n- A 2FA method such as `totp` is enabled.\n- `required_aal` of the whomai check or the settings flow is set to `highest_available`. AAL stands for Authenticator Assurance Levels and can range from 0 (no factor) to 2 (two factors).\n- A user uses the `code` method as the **only** login method available. They do not have a password or any other first factor credential enabled.\n- The user has 2FA enabled.\n- The user’s `available_aal` is incorrectly stored in the database as `aal1` or `aal0` or `NULL`.\n- A user signs in using the code method, but does not complete the 2FA challenge.\n\n**Example server configuration**\n\nBelow you will find an vulnerable example configuration. Keep in mind that, for the account to be vulnerable, the account must have no first factor except the `code` method enabled plus a second factor.\n\n```\nselfservice:\n  methods:\n    code:\n      # The `code` login method is enabled with the `passwordless_enabled` flag set to `true`\n      passwordless_enabled: true\n    totp:\n      # 2FA method such as `totp` is enabled\n      enabled: true\n  flows:\n    settings:\n      # This is set\n      required_aal: highest_available\nsession:\n  whoami:\n    # Or this\n    required_aal: highest_available\n```\n\n## Impact\n\nGiven the preconditions, the `highest_available` setting will incorrectly assume that the identity’s highest available AAL is `aal1` even though it really is `aal2`. This means that the `highest_available` configuration will act as if the user has only one factor set up, for that particular user. This means that they can call the settings and whoami endpoint without a `aal2` session, even though that should be disallowed.\n\nAn attacker would need to steal or guess a valid login OTP of a user who has only OTP for login enabled and who has an incorrect `available_aal` value stored, to exploit this vulnerability.\n\nAll other aspects of the session (e.g. the session’s aal) are not impacted by this issue.\n\nOn Ory Network, only 0,00066% of registered users were affected by this issue, and most of those users appeared to be test users. Their respective AAL values have since been updated and they are no longer vulnerable to this attack.\n\n### Patches\n\nVersion 1.3.0 is not affected by this issue.\n\n### Workarounds\n\nIf you require 2FA please disable the passwordless code login method. If that is not possible, check the sessions `aal` to identify if the user has `aal1` or `aal2`.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Ory Kratos's setting required_aal `highest_available` does not properly respect code + mfa credentials in github.com/ory/kratos","format":"markdown","source":"go"},{"lang":"es","text":"Ory Kratos es un sistema de autenticación, gestión de usuarios e identidad para servicios en la nube. Antes de la versión 1.3.0, dadas una serie de condiciones previas, la configuración `highest_available` suponía incorrectamente que el AAL más alto disponible de la identidad era `aal1`, aunque en realidad era `aal2`. Esto significa que la configuración `highest_available` actuaría como si el usuario tuviera solo un factor configurado para ese usuario en particular. Esto significa que pueden llamar a la configuración y al endpoint whoami sin una sesión `aal2`, aunque eso debería estar prohibido. Un atacante necesitaría robar o adivinar un OTP de inicio de sesión válido de un usuario que solo tiene habilitado el OTP para el inicio de sesión y que tiene un valor `available_aal` incorrecto almacenado, para explotar esta vulnerabilidad. Todos los demás aspectos de la sesión (por ejemplo, el aal de la sesión) no se ven afectados por este problema. En la red Ory, solo el 0,00066 % de los usuarios registrados se vieron afectados por este problema, y la mayoría de esos usuarios parecían ser usuarios de prueba. Desde entonces, se han actualizado sus respectivos valores AAL y ya no son vulnerables a este ataque. La versión 1.3.0 no se ve afectada por este problema. Como workaround, quienes requieran MFA deben deshabilitar el método de inicio de sesión con código sin contraseña. Si eso no es posible, verifique las sesiones `aal` para identificar si el usuario tiene `aal1` o `aal2`.","source":"nvd"}],"published":"2024-09-26T17:04:59.235Z","modified":"2026-06-17T07:53:28.863Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N","score":4.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-287"],"affected":[{"ranges":[{"version":"< 1.3.0","status":"affected"}],"vendor":"ory","product":"kratos","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"Go","package":"github.com/ory/kratos","purl":"pkg:golang/github.com/ory/kratos","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"Go","package":"github.com/ory/kratos","purl":"pkg:golang/github.com/ory/kratos","source":"go"}],"references":[{"url":"https://github.com/ory/kratos/security/advisories/GHSA-wc43-73w7-x2f5","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45042","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ory/kratos","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-10T17:12:37.404Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-45042","url":"https://www.cve.org/CVERecord?id=CVE-2024-45042","licence":"CVE Terms of Use","modified":"2025-03-12T21:17:22.281Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wc43-73w7-x2f5","url":"https://github.com/advisories/GHSA-wc43-73w7-x2f5","licence":"CC-BY-4.0","modified":"2024-09-26T21:11:01.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-3160","url":"https://pkg.go.dev/vuln/GO-2024-3160","licence":"CC-BY-4.0","modified":"2026-03-03T04:52:02.769Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-45042","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45042","licence":"Public domain","modified":"2026-06-17T07:53:28.863Z"}],"updatedAt":"2026-11-25T22:58:45.794Z","epss":{"score":0.00327,"percentile":0.27838,"date":"2026-12-01T12:00:22.000Z"}}