# CVE-2024-5967: Keycloak: leak of configured ldap bind credentials through the keycloak admin console

> An admin can leak LDAP bind credentials by changing the connection URL to an attacker-controlled host, exposing domain credentials.

- **Severity:** Low 2.7 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/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:** 18 Jun 2024
- **Updated:** 26 Mar 2026
- **Also known as:** GHSA-c25h-c27q-5qpv

## What is CVE-2024-5967?

CVE-2024-5967 is a low-severity vulnerability in Red Hat RHEL-8 based Middleware Containers, published on 18 Jun 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

A vulnerability was found in Keycloak. The LDAP testing endpoint allows changing the Connection URL  independently without re-entering the currently configured LDAP bind credentials. This flaw allows an attacker with admin access (permission manage-realm) to change the LDAP host URL ("Connection URL") to a machine they control. The Keycloak server will connect to the attacker's host and try to authenticate with the configured credentials, thus leaking them to the attacker. As a consequence, an attacker who has compromised the admin console or compromised a user with sufficient privileges can leak domain credentials and attack the domain.

Weakness: CWE-276 (Incorrect Default Permissions)

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

6 open source packages ship an affected version, including org.keycloak:keycloak-ldap-federation.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.keycloak:keycloak-ldap-federation` | Maven | All versions | 22.0.12 |
| `org.keycloak:keycloak-ldap-federation` | Maven | All versions | 22.0.12 |
| `org.keycloak:keycloak-ldap-federation` | Maven | From 23.0.0 | 24.0.6 |
| `org.keycloak:keycloak-ldap-federation` | Maven | From 23.0.0 | 24.0.6 |
| `org.keycloak:keycloak-ldap-federation` | Maven | From 25.0.0 | 25.0.1 |
| `org.keycloak:keycloak-ldap-federation` | Maven | From 25.0.0 | 25.0.1 |

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

Upgrade org.keycloak:keycloak-ldap-federation to a fixed version for your release line: 22.0.12, 24.0.6 or 25.0.1.

## Is CVE-2024-5967 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-5967 is a low-severity vulnerability in Red Hat RHEL-8 based Middleware Containers, published on 18 Jun 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-5967 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.keycloak:keycloak-ldap-federation (Maven): affected all versions; fixed in 22.0.12
- org.keycloak:keycloak-ldap-federation (Maven): affected all versions; fixed in 22.0.12
- org.keycloak:keycloak-ldap-federation (Maven): affected from 23.0.0; fixed in 24.0.6
- org.keycloak:keycloak-ldap-federation (Maven): affected from 23.0.0; fixed in 24.0.6
- org.keycloak:keycloak-ldap-federation (Maven): affected from 25.0.0; fixed in 25.0.1
- org.keycloak:keycloak-ldap-federation (Maven): affected from 25.0.0; fixed in 25.0.1

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-5967/ (Markdown: https://insights.sbomify.com/CVE-2024-5967/index.md)
```

## Sources

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

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