8000 [CVE-2026-93998] Validate SAML issuer against configured IdP entity ID by abstractj · Pull Request #55011 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[CVE-2026-93998] Validate SAML issuer against configured IdP entity ID - #55011

Draft
abstractj wants to merge 3 commits into
keycloak:mainfrom
abstractj:issue-54703-backport-cve-2026-93998
Draft

abstractj wants to merge 3 commits into
keycloak:mainfrom
abstractj:issue-54703-backport-cve-2026-93998

Conversation

@abstractj
Copy link
Copy Markdown
Contributor

Backport to main of the CVE-2026-93998 fix released in 26.8.2, 26.6.8 and 26.4.17.

The SAML adapter verified signatures, audience, recipient, and time conditions but never
checked whether the assertion actually came from the expected identity provider. When distinct
IdP issuers share a signing key, an attacker controlling one issuer could forge assertions
selecting arbitrary principals and roles.

This commit adds issuer validation in AbstractSamlAuthenticationHandler.handleLoginResponse()
and on the LogoutRequest path, and updates the adapter installation endpoints to generate
the actual realm URL as the IdP entity ID instead of the hardcoded placeholder idp.

Closes #54703

Backport to main of the CVE-2026-93998 fix released in 26.8.2, 26.6.8
and 26.4.17.

Closes keycloak#54703

Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
Move CVE-2026-93998 issuer validation test from the deprecated
testsuite/ (Arquillian adapter test) to the new tests/ framework
(broker-based test) to comply with the testsuite deprecation check.

- Remove SamlIssuerValidationTest from old testsuite
- Revert ModifySamlResponseStepBuilder signing additions (only needed
  by removed test)
- Add issuer mutation helpers to SamlResponseDocument
- Create KcSamlBrokerIssuerValidationTest exercising the broker-side
  issuer validation against the configured IdP entity ID

Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
@abstractj
abstractj force-pushed the issue-54703-backport-cve-2026-93998 branch from 8857567 to ef0e7cc Compare November 10, 2026 18:14
@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.adapter.servlet.SAMLServletAdapterTest#salesPostSigEmailTest

Keycloak CI - Adapter IT

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#testReloginWithInvalidAuthSessionCookie

Keycloak CI - Adapter IT

org.opentest4j.AssertionFailedError: Expected page 'login-login' to be loaded, but currently on page 'null' after timeout
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
	at org.junit.jupiter.api.Assertions.fail(Assertions.java:138)
	at org.keycloak.testsuite.pages.AbstractPage.waitForPage(AbstractPage.java:63)
	at org.keycloak.testsuite.pages.AbstractPage.assertCurrent(AbstractPage.java:48)
...

Report flaky test

The broker requires a non-null response issuer when idpEntityId is
configured, unlike the adapter which treats it as optional. Update
the test to expect rejection when the response-level issuer is removed.

Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
@abstractj
abstractj force-pushed the issue-54703-backport-cve-2026-93998 branch from a52851f to b3522ed Compare November 10, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CVE-2026-93998] SAML adapter accepts assertions from the wrong configured issuer

1 participant

0