Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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>
9f2d853 to
690e0d9
Compare
There was a problem hiding this comment.
🔵 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
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.webauthn.passwordless.PasskeysOrganizationAuthenticationTest#passwordLoginWithNonDiscoverableCredential |

closes #55378