CVE-2024-5967: Keycloak ldap federation Keycloak Leaks Configured LDAP Bind Vulnerability
LOWCVE-2024-5967 is a LOW (CVSS 2.7) keycloak leaks configured ldap bind vulnerability (CWE-276: Incorrect Default Permissions) affecting Keycloak ldap federation libraries in the Maven ecosystem. The issue involves keycloak leaks configured ldap bind credentials through the keycloak admin console. Remediation is available by upgrading affected packages to version 25.0.1, 22.0.12, 24.0.6.
CVE-2024-5967 at a Glance
Security Impact
CVSS: 2.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2024-5967
To remediate this vulnerability, upgrade all affected Keycloak ldap federation dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-ldap-federation</artifactId>
<version>25.0.1</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-ldap-federation</artifactId>
<version>22.0.12</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-ldap-federation</artifactId>
<version>24.0.6</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.keycloak
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-5967, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.keycloak
Analyze the terminal output to locate any version of Keycloak ldap federation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.0.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.keycloak command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Keycloak ldap federation, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-5967 Affected Keycloak ldap federation Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.keycloak:keycloak-ldap-federation
|
Maven |
≥ 25.0.0
< 25.0.1
All 1 versions
25.0.0
|
25.0.1
|
|
org.keycloak:keycloak-ldap-federation
|
Maven |
< 22.0.12
|
22.0.12
|
|
org.keycloak:keycloak-ldap-federation
|
Maven |
≥ 23.0.0
< 24.0.6
|
24.0.6
|
References
Frequently Asked Questions
What is CVE-2024-5967?
Which Keycloak ldap federation versions are affected?
What version fixes CVE-2024-5967?
Is keycloak-ldap-federation affected?
What is the CVSS score of CVE-2024-5967?
What CWE is associated with CVE-2024-5967?
How can I check Maven dependencies for CVE-2024-5967?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c25h-c27q-5qpv",
"modified" : "2024-07-01T14:39:53Z",
"published" : "2024-06-21T15:52:38Z",
"aliases" : [ "CVE-2024-5967" ],
"summary" : "Keycloak leaks configured LDAP bind credentials through the Keycloak admin console",
"details" : "### Impact\n\nThe LDAP testing endpoint allows to change the Connection URL independently of and without having to re-enter the currently configured LDAP bind credentials. An attacker with admin access (permission manage-realm) can 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.\nAs a consequence, an attacker who has compromised the admin console/compromised a user with sufficient privileges can leak domain credentials and can now attack the domain.\n\n### Acknowledgements\n\nSpecial thanks to Simon Wessling for reporting this issue and helping us improve our project",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.keycloak:keycloak-ldap-federation"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "25.0.0"
}, {
"fixed" : "25.0.1"
} ]
} ],
"versions" : [ "25.0.0" ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.keycloak:keycloak-ldap-federation"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "22.0.12"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 22.0.11"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.keycloak:keycloak-ldap-federation"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "23.0.0"
}, {
"fixed" : "24.0.6"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 24.0.5"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/keycloak/keycloak/security/advisories/GHSA-c25h-c27q-5qpv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-5967"
}, {
"type" : "WEB",
"url" : "https://github.com/keycloak/keycloak/issues/30434"
}, {
"type" : "WEB",
"url" : "https://github.com/keycloak/keycloak/commit/0d0530046b9cb4b0d74d2fdefc9bd04f1d20cac0"
}, {
"type" : "WEB",
"url" : "https://github.com/keycloak/keycloak/commit/1f56a9e48bf96c3bcb18dfc6cd93e3dd16f281f1"
}, {
"type" : "WEB",
"url" : "https://github.com/keycloak/keycloak/commit/bde8568d4174a7072f7c7bb507d2c7d05824b1a6"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2024-5967"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2292200"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/keycloak/keycloak"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-276" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-21T15:52:38Z",
"nvd_published_at" : null
}
}