Skip to content

Information disclosure - service-account-user returns the service account user representation to view-clients without per-user authorization (ClientResource.getServiceAccountUser) #54047

Description

@abstractj

Describe the bug

The Admin REST API endpoint GET /admin/realms/{realm}/clients/{client-id}/service-account-user returns the full user representation of a client's service account user — including administrator-defined custom attributes — after checking only view permission on the client. It does not verify whether the caller is authorized to view that user.

A delegated administrator holding only view-clients (without view-users or any per-user view permission) can read the service account user's profile and attributes through this endpoint, even though the dedicated user endpoint GET /admin/realms/{realm}/users/{user-id} correctly denies the same caller with 403.

All other user-returning admin endpoints (getUser, getUsers, getUsersInRole, getUserSessions) apply a per-user authorization check. getServiceAccountUser is the only user-representation-returning admin endpoint that omits it.

Version

Keycloak 26.8.0. Also affects the current main branch.

Expected behavior

getServiceAccountUser() should enforce per-user authorization (e.g., auth.users().requireView(user)) before returning the user representation, consistent with all other user-returning admin endpoints.

Actual behavior

The endpoint enforces only auth.clients().requireView(client) and returns the full UserRepresentation — including custom attributes — without any per-user authorization check. A view-clients-only administrator can enumerate every confidential client's service account user across the realm.

Acknowledgement

Thank you to garry15907 (WHS4th Team TokenManiZo) for reporting this issue. As the caller must already be an authenticated realm administrator with view-clients and the impact is limited to read-only disclosure of service account user profiles, this is considered a weakness and handled publicly.


This issue was originally tracked in the private repository. Migrated by @abstractj.

Activity

  1. added
    area/authorization-services
    priority/important
    on Oct 15, 2026
  2. self-assigned this
    on Oct 16, 2026
  3. added 8 commits that reference this issue on Oct 19, 2026
    da9edcf
    1c5379e
    521ad8e
    5071d9e
    baba68b
    2c421da
    68fc3f1
    568fba0
  4. added a commit that references this issue on Oct 20, 2026
    e203767
  5. added 2 commits that reference this issue on Oct 22, 2026
    057aeb9
    fc23296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/authorization-serviceskind/weaknesspriority/importantrelease/27.0.0team/core-iam

Fields

No fields configured for weakness.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions