Skip to content

Partial evaluation misses ancestor group policies with extendChildren#51186

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

Partial evaluation misses ancestor group policies with extendChildren#51186
vramik wants to merge 1 commit into
keycloak:mainfrom
vramik:cve-889

Conversation

@vramik

@vramik vramik commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closes #51144

Copilot AI review requested due to automatic review settings July 27, 2026 09:49
@vramik
vramik requested a review from a team as a code owner July 27, 2026 09:49

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

Fixes FGAP partial evaluation for ancestor group policies using extendChildren.

Changes:

  • Includes ancestor group IDs during policy discovery.
  • Adds two- and three-level hierarchy regression tests for direct reads, search, and count.

Reviewed changes

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

File Description
GroupPolicyProvider.java Expands group-policy lookup to ancestor groups.
UserResourceTypeFilteringTest.java Tests negative ancestor policies with extendChildren.

Comment on lines +116 to +120
List<String> groupIds = user.getGroupsStream()
.flatMap(group -> {
List<String> ids = new ArrayList<>();
GroupModel current = group;
while (current != null) {
Comment on lines +115 to +123
// getParent() issues a query per ancestor; may need optimization for deep hierarchies
List<String> groupIds = user.getGroupsStream()
.flatMap(group -> {
List<String> ids = new ArrayList<>();
GroupModel current = group;
while (current != null) {
ids.add(current.getId());
current = current.getParent();
}
@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.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabled

Keycloak CI - Java Distribution IT (windows-latest - temurin - 17)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for value to contain (ignoring case) "sign in to". Current value: "AUTH_RESPONSE" (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2025', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.19'
Driver info: org.jboss.arquillian.drone.webdriver.htmlunit.DroneHtmlUnitDriver_ByGraphene
...

Report flaky test

@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

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.

Partial evaluation misses ancestor group policies with extendChildren

2 participants