Upgrade ApacheDS to 2.0.0.AM27 to address CVE-2026-35563#51124
Upgrade ApacheDS to 2.0.0.AM27 to address CVE-2026-35563#51124sguilhen wants to merge 3 commits into
Conversation
53419f2 to
f0f0bf3
Compare
|
Notes about the changes needed to bump Apache DS to 2.0.0.AM27:
Aside from that, there's a minor architectural change between the versions: in AM26, the ApacheDS KDC accessed the DirectoryService in-process (via |
|
Also worth mentioning: I've had to add |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabledKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.forms.MultipleTabsLoginTest#testLoginPageRefreshKeycloak CI - Forms IT (firefox) |
There was a problem hiding this comment.
Pull request overview
Upgrades ApacheDS and LDAP API dependencies to address CVE-2026-35563 while migrating embedded Kerberos support to Apache Kerby.
Changes:
- Upgrades ApacheDS to AM27 and LDAP API to 2.1.8.
- Replaces removed ApacheDS KDC/keytab APIs with Kerby.
- Updates Kerberos fixtures and delegation behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pom.xml |
Updates and aligns ApacheDS/LDAP API versions. |
util/embedded-ldap/pom.xml |
Adds Kerby dependencies. |
util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java |
Migrates keytab generation to Kerby. |
util/embedded-ldap/src/main/resources/kerberos/default-users.ldif |
Adds Kerby-required account attributes. |
util/embedded-ldap/src/main/resources/kerberos/default-users-kc2.ldif |
Adds attributes for the secondary realm. |
testsuite/utils/pom.xml |
Adds Kerby test utilities. |
testsuite/utils/src/main/java/org/keycloak/testsuite/KerberosEmbeddedServer.java |
Replaces ApacheDS KDC with Kerby LDAP-backed KDC. |
testsuite/integration-arquillian/tests/base/src/test/resources/kerberos/users-kerberos.ldif |
Updates primary-realm test identities. |
testsuite/integration-arquillian/tests/base/src/test/resources/kerberos/users-kerberos-kc2.ldif |
Updates secondary-realm test identities. |
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/KeycloakSPNegoSchemeFactory.java |
Makes credential delegation configurable. |
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosTest.java |
Disables delegation for embedded Kerby. |
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosSingleRealmTest.java |
Changes delegation-test eligibility. |
| Assume.assumeTrue("Credential delegation not supported with embedded Kerby KDC", | ||
| !getKerberosRule().isStartEmbeddedLdapServer()); |
There was a problem hiding this comment.
True observation but this condition is pre-existing. The invokeLdap method was never designed for external providers. When the internal MSAD pipeline runs the credential delegation test, it would need the LDAP URL/DN adapted. But this isn't something we introduced, it was already the case before our change.
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (ubuntu-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (ubuntu-latest - temurin - 21) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosSingleRealmTest.java:181
- This now skips
credentialDelegationTestunder every checked-in Kerberos configuration: the connection files either setidm.test.ldap.start.embedded.ldap.server=trueor rely on itstruedefault. Credential delegation therefore loses all automated coverage; please add a runnable external-KDC configuration/job (or another fixture) instead of leaving this test permanently skipped.
Assume.assumeTrue("Credential delegation not supported with embedded Kerby KDC",
!getKerberosRule().isStartEmbeddedLdapServer());
Closes keycloak#50785 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
f207204 to
82cfd60
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserCredentialVaultAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRegisterClickKeycloak CI - Forms IT (firefox) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserCredentialVaultAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (ubuntu-latest - temurin - 21) |
| for (EncryptionType encType : KEYTAB_ENC_TYPES) { | ||
| EncryptionKey key = EncryptionHandler.string2Key(principalName, passPhrase, encType); | ||
| System.out.println("Adding keytab entry of type: " + encType.getName()); | ||
| entries.add(new KeytabEntry(principal, timeStamp, key.getKvno(), key)); |
| Hashtable<String, String> env = new Hashtable<>(); | ||
| env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); | ||
| env.put(Context.PROVIDER_URL, "ldap://" + this.bindHost + ":" + this.bindPort); |
82cfd60 to
5e8ea7d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java:98
EncryptionHandler.string2Keyreturns a key with Kerby's default KVNO of-1; passing that through writes0xff(KVNO 255) into the keytab instead of the previous implementation's KVNO 0. This can prevent the generated keytab from matching service tickets, so pass an explicit KVNO (0 preserves the old behavior).
entries.add(new KeytabEntry(principal, timeStamp, key.getKvno(), key));
5e8ea7d to
c1cd6b9
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserCredentialVaultAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (ubuntu-latest - temurin - 21) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java:98
EncryptionHandler.string2KeyinitializesEncryptionKeywith kvno-1, so passingkey.getKvno()makes Kerby's keytab writer serialize version255. The previous implementation produced kvno0(the wildcard version); keep that value explicitly so generated keytabs can match the versioned tickets issued by the LDAP-backed KDC.
entries.add(new KeytabEntry(principal, timeStamp, key.getKvno(), key));
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 17) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserCredentialVaultAuthenticationSimpleEncryptionStartTLSKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) org.keycloak.testsuite.federation.ldap.LDAPUserLoginTest#loginLDAPUserAuthenticationNoneEncryptionStartTLSKeycloak CI - Java Distribution IT (ubuntu-latest - temurin - 21) |
Closes #50785