Skip to content

Keycloak 26.8.2 CIMD backchannel_logout_uri causes POST to loopback address - #55400

Open
tnorimat wants to merge 1 commit into
keycloak:mainfrom
Hitachi:ISSUE-55378
Open

tnorimat wants to merge 1 commit into
keycloak:mainfrom
Hitachi:ISSUE-55378

Conversation

@tnorimat

Copy link
Copy Markdown
Contributor

closes #55378

@tnorimat
tnorimat requested a review from a team as a code owner November 20, 2026 09:40
Copilot AI balanced review requested due to automatic review settings November 20, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Stored backchannel endpoints can bypass same-domain restrictions, and authorization-time DNS checks leave an SSRF path because outbound requests and redirects lack destination enforcement.

2 open issues
What changed in this PR

This PR extends Keycloak’s experimental Client ID Metadata Document (CIMD) validation to backchannel endpoints, addressing unchecked logout and CIBA notification destinations reported in #55378.

Changes:

  • Applies URI restrictions to fetched backchannel endpoints and rechecks stored endpoints during authorization.
  • Adds unit and integration coverage for rejected destinations, cached metadata, refreshes, and same-domain restrictions.
  • Updates configuration help and documentation with validation behavior, limitations, and upgrade guidance.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​client/​policies/​ClientIdMetadataDocumentTest.java Tests backchannel validation, persistence, refreshes, and same-domain rules.
services/​src/​test/​java/​org/​keycloak/​protocol/​oauth2/​cimd/​clientpolicy/​executor/​ClientIdMetadataDocumentExecutorTest.java Tests scheme and private-address restrictions for both endpoints.
services/​src/​main/​java/​org/​keycloak/​protocol/​oauth2/​cimd/​clientpolicy/​executor/​AbstractClientIdMetadataDocumentExecutorFactory.java Updates configuration help to include backchannel endpoints.
services/​src/​main/​java/​org/​keycloak/​protocol/​oauth2/​cimd/​clientpolicy/​executor/​AbstractClientIdMetadataDocumentExecutor.java Adds fetched and persisted backchannel URL checks.
docs/​guides/​securing-apps/​mcp-authz-server.adoc Documents endpoint restrictions and outbound-validation limitations.
docs/​documentation/​upgrading/​topics/​changes/​changes-27_0_0.adoc Explains new checks and cleanup guidance for existing CIMD clients.

Review effort: Balanced

…ddress

Closes keycloak#55378

Signed-off-by: Takashi Norimatsu <takashi.norimatsu.ws@hitachi.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human review is needed to determine whether deferred outbound DNS/destination and redirect enforcement, alongside required cleanup of pre-upgrade CIMD clients, adequately mitigates the remaining SSRF risk.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@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.webauthn.passwordless.PasskeysOrganizationAuthenticationTest#passwordLoginWithNonDiscoverableCredential

Keycloak CI - WebAuthn 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

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.

Keycloak 26.8.2 CIMD backchannel_logout_uri causes POST to loopback address

2 participants