# CVE-2024-45042: Ory Kratos's `highest_available` setting does not properly respect code + mfa credentials

> Attackers can bypass MFA requirements on specific endpoints by exploiting a logic error in the highest_available setting, allowing unauthorized access with lower assurance levels.

- **Severity:** Medium 4.4 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Sep 2024
- **Updated:** 12 Mar 2025
- **Also known as:** GHSA-wc43-73w7-x2f5, GO-2024-3160

## What is CVE-2024-45042?

CVE-2024-45042 is a medium-severity authentication bypass vulnerability in ory kratos, published on 26 Sep 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

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`.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2024-45042?

3 open source packages ship an affected version, including github.com/ory/kratos.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/ory/kratos` | Go | All versions | 1.3.0 |
| `github.com/ory/kratos` | Go | All versions | 1.3.0 |
| `github.com/ory/kratos` | Go | All versions | 1.3.0 |

## How do I fix CVE-2024-45042?

Upgrade github.com/ory/kratos to 1.3.0 or later.

## Is CVE-2024-45042 being exploited?

There is no known exploitation of CVE-2024-45042 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-45042 and fix it if it is affected.

What it is: CVE-2024-45042 is a medium-severity authentication bypass vulnerability in ory kratos, published on 26 Sep 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-45042 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/ory/kratos (Go): affected all versions; fixed in 1.3.0
- github.com/ory/kratos (Go): affected all versions; fixed in 1.3.0
- github.com/ory/kratos (Go): affected all versions; fixed in 1.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-45042/ (Markdown: https://insights.sbomify.com/CVE-2024-45042/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-45042
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-45042
- OSV: https://osv.dev/vulnerability/CVE-2024-45042

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-45042/
Summaries are generated and may contain mistakes; the official description above is the record.
