You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Information disclosure - service-account-user returns the service account user representation to view-clients without per-user authorization (ClientResource.getServiceAccountUser) #54047
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
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…
Service account user ID available on client representation instead of…