Skip to content

[Backport 26.6] fix: validate resource type consistency when adding resources to FGAP permissions#48519

Merged
stianst merged 1 commit intokeycloak:release/26.6from
pedroigor:issue-37243-bp-26.6
Apr 28, 2026
Merged

[Backport 26.6] fix: validate resource type consistency when adding resources to FGAP permissions#48519
stianst merged 1 commit intokeycloak:release/26.6from
pedroigor:issue-37243-bp-26.6

Conversation

@pedroigor
Copy link
Copy Markdown
Contributor

Previously, getOrCreateResource() would return any resource found by its authz DB ID without verifying it belonged to the requested resource type. This allowed resources of one type (e.g. Users) to be silently added to a permission of a different type (e.g. Groups) by passing the internal authz resource ID.

  • For per-entity resources found by ID, validate the name resolves as the expected entity type via getResourceName(); throw ModelValidationException on mismatch

Closes #37243

… permissions

Previously, getOrCreateResource() would return any resource found by its
authz DB ID without verifying it belonged to the requested resource type.
This allowed resources of one type (e.g. Users) to be silently added to a
permission of a different type (e.g. Groups) by passing the internal authz
resource ID.

- For per-entity resources found by ID, validate the name resolves as the
  expected entity type via getResourceName(); throw ModelValidationException
  on mismatch

Closes keycloak#37243

Signed-off-by: Vinit Kumar <[email protected]>
@pedroigor pedroigor requested a review from a team as a code owner April 27, 2026 17:47
@stianst stianst merged commit 03cf229 into keycloak:release/26.6 Apr 28, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants