Skip to content

Admin API per-request cost grows super-linearly with realm count since 26.7.1 #51554

Closed

Description

@JessThrysoee

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/api

Describe the bug

Every Admin API request, for a master-realm admin holding admin, has regressed in its scaling with the number of realms in the installation. With 400 realms, every admin console request takes 9–13 s for us.

I seems to have been intoduces by 200e655 ("Make sure admin role checks are based on the actual roles granted to the
user", CVE-2026-4629).

It looks like it is the calls to removeTransientAdminRoles in addRolesAsAttributes that causes this, combined with the admin lightweight tokens are expanded to every realm on the server side.

This may be the same problem reported in #51523 if their systems have many realms and they use an admin token.

Version

26.7.1

Regression

  • The issue is a regression

Expected behavior

Same performance as 26.7.0 for admin API calls and Admin console.

Actual behavior

I tried timing the difference bewteen therelease/26.7 branch and the same branch with only the two removeTransientAdminRoles calls in addRolesAsAttributes removed:

realms as-is two calls removed ratio
10 7 ms 5 ms 1x
50 40 ms 6 ms 7x
100 141 ms 6 ms 24x
200 551 ms 11 ms 50x
250 3628 ms 15 ms 242x
300 11367 ms 18 ms 632x
350 19157 ms 24 ms 798x

How to Reproduce?

  1. Create N empty realms.
  2. As a master-realm admin holding the admin role, against any non-master realm:
TOKEN=$(curl -s http://localhost:8080/realms/master/protocol/openid-connect/token \
  -d client_id=admin-cli -d grant_type=password -d username=admin -d password=admin \
  | jq -r .access_token)

time curl -s -o /dev/null -H "Authorization: Bearer $TOKEN" \
  http://localhost:8080/admin/realms/myrealm

Anything else?

No response

Activity

  1. added
    kind/bug
    on Aug 8, 2026
  2. added theissue type on Aug 8, 2026
  3. added
    area/admin/api
    on Aug 8, 2026
  4. self-assigned this
    on Aug 10, 2026
  5. 22 remaining items

  6. AleksanderKlymchuk commented on Aug 26, 2026

    @AleksanderKlymchuk

    Hi, do you have an estimated release date for 26.7.3?

  7. ahus1 commented on Aug 31, 2026

    @ahus1
    Member

    @JessThrysoee - a fixed version 26.7.3 was released earlier today. Please let me know if this fixes your problem.

  8. yanxch commented on Sep 11, 2026

    @yanxch

    When is the release for 26.6.7 planned? Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/admin/apihelp wantedkind/bugpriority/blockerrelease/26.4.16release/26.6.7release/26.7.3release/26.8.0team/core-iam

Type

Fields

No fields configured for bug.

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions