Skip to content

Incorrect authorization in admin role-composite deletion - delegated …#51136

Open
vramik wants to merge 1 commit into
keycloak:mainfrom
vramik:cve-809
Open

Incorrect authorization in admin role-composite deletion - delegated …#51136
vramik wants to merge 1 commit into
keycloak:mainfrom
vramik:cve-809

Conversation

@vramik

@vramik vramik commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

…admin removes privileged child roles it cannot map

Closes todo

…admin removes privileged child roles it cannot map

Closes todo

Signed-off-by: vramik <vramik@redhat.com>
@vramik
vramik requested a review from a team as a code owner July 24, 2026 12:46
Copilot AI review requested due to automatic review settings July 24, 2026 12:46

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.

Pull request overview

Adds composite-role deletion authorization checks so delegated admins cannot remove child roles they lack permission to map.

Changes:

  • Requires MAP_ROLE_COMPOSITE permission for every removed child role.
  • Applies enforcement across role-by-name and role-by-ID endpoints.
  • Adds regression coverage for realm and client roles.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
RoleResourceTypeEvaluationTest.java Tests permitted and forbidden composite deletions.
RoleResource.java Enforces child-role mapping authorization.
RoleContainerResource.java Passes authorization evaluator to deletion logic.
RoleByIdResource.java Enforces authorization for ID-based deletion.

@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.forms.MultipleTabsLoginTest#testLoginPageRefresh

Keycloak CI - Forms IT (chrome)

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.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRegisterClick

Keycloak CI - Forms IT (chrome)

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

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.

2 participants