Repository navigation
fix(admin): reject retyping a component into an internal provider via update - #54501
Open
Angel-Tornero wants to merge 2 commits into
Open
Angel-Tornero wants to merge 2 commits into
Angel-Tornero wants to merge 2 commits into
Conversation
… update ComponentResource.updateComponent only validated the stored component's provider type, letting a component be retyped into an internal provider (such as WorkflowProvider) through a PUT, bypassing the restriction already enforced on create. Closes keycloak#54415 Signed-off-by: Angel-Tornero <angeltornerohdez@gmail.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the provider-validation update.
No open issues 🎉
What changed in this PR
This PR closes the Component API update bypass described in #54415 by validating the requested provider type and ID, preventing allowed components from being retyped into internal providers.
Changes:
- Validates incoming provider values before updating, falling back to stored values when fields are omitted.
- Adds a regression test confirming that retyping a key provider into a workflow provider is forbidden and leaves the stored provider values unchanged.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/workflow/WorkflowManagementTest.java |
Tests rejection of retyping into an internal provider and preservation of stored values. |
services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java |
Checks the requested provider type and ID against internal-provider restrictions. |
Review effort: Balanced
This was referenced Nov 4, 2026
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.adapter.servlet.SAMLClockSkewAdapterTest#testTokenTimeIsValid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ComponentResource.updateComponentonly validated the stored component's provider type, letting a component be retyped into an internal provider (such asWorkflowProvider) through a PUT, bypassing the restriction already enforced on create.The fix validates the incoming payload's effective
providerType/providerId(payload value if present, otherwise the stored one), alongside the existing check on the stored component. The payload-side check also covers partial payloads, though that path currently can't be reached in practice due to an unrelated bug (partial updates return 500), filed separately as #54504.AI assisted locating the relevant code and proposing the fix approach; I implemented, reviewed and verified it.
Closes #54415