Upgrade ApacheDS to 2.0.0.AM27 to address CVE-2026-35563 - #51124
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());
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) |
122e8a4 to
bea1556
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java:98
EncryptionHandler.string2Keyleaves Kerby's key version at-1, so this writes255into the keytab's one-byte KVNO field instead of the previous generator's KVNO0. That value will not act as the wildcard KVNO when the embedded KDC issues tickets with KVNO 1; write0explicitly to keep generated keytabs usable.
entries.add(new KeytabEntry(principal, timeStamp, key.getKvno(), key));
testsuite/utils/src/main/java/org/keycloak/testsuite/KerberosEmbeddedServer.java:147
- If Kerby initialization or socket binding fails after
super.start(), JUnit'sExternalResourcedoes not invokeafter()whenbefore()throws, leaving the LDAP server and directory service running and their ports occupied. Wrap KDC startup in rollback logic that stops any partially initialized KDC and callssuper.stop()before rethrowing.
super.start();
log.info("Creating KDC server. kerberosRealm: " + kerberosRealm + ", kdcPort: " + kdcPort + ", kdcEncryptionTypes: " + kdcEncryptionTypes);
createAndStartKdcServer();
mposolda
left a comment
There was a problem hiding this comment.
@sguilhen Thanks, it is not ideal that we do not test with credential delegation (and maybe we don't even have a way to test manually with that), but approving to move forward with this PR. I don't recall any issues with credential delegation in the past, so hopefully it is OK to keep it like this.
Would be probably good to have review from QA team as well to avoid some potential issues in the pipeline (however I think it should work just fine).
bea1556 to
d6a2878
Compare
d6a2878 to
0968d3b
Compare
0968d3b to
304b96b
Compare
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>
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
304b96b to
ca13773
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.forms.BruteForceTest#testExceedMaxTemporaryLockouts |
Closes #50785