[CVE-2026-97177] Generic user update bypasses denied reset-password permission
Describe the bug
A flaw was found in Keycloak's Fine-Grained Admin Permissions (FGAP). The generic user update endpoint (PUT /admin/realms/{realm}/users/{id}) checks only the generic manage permission before processing the request payload. It does not enforce the fine-grained reset-password authorization. A delegated administrator who has been granted view and manage permissions on a target user but explicitly denied reset-password authority can include a credentials object in the user update payload, bypassing the authorization check and creating an attacker-selected password for the target user, leading to account takeover.
The dedicated password reset endpoint (POST /admin/realms/{realm}/users/{id}/reset-password) correctly enforces the fine-grained reset-password permission and returns HTTP 403 for the same caller. Only the generic user update path is affected.
Version
26.7.4 (present on main; commit c6e9851ea1ea821055f5dd11ace033aa9ebf5e15 confirmed)
Expected behavior
When a user update request contains a credentials field, the server must verify that the caller also holds reset-password permission before creating or replacing credentials. A caller explicitly denied reset-password authority should receive HTTP 403 when supplying credentials via the generic update endpoint, consistent with the behavior of the dedicated reset-password endpoint.
Actual behavior
The generic user update endpoint accepts credentials in the payload after checking only requireManage. When the caller has manage but is explicitly denied reset-password, the dedicated reset-password endpoint returns HTTP 403, but the same credential change succeeds via PUT /admin/realms/{realm}/users/{id} — the stored credential is created with the attacker-selected password and the profile is updated.
Anything else?
- Tracked as CVE-2026-97177.
- The root cause is that
UserResource.updateUser()calls onlyrequireManage(user)beforeRepresentationToModel.createCredentials()processes credentials from the payload. The dedicatedresetPassword()endpoint callsrequireResetPassword(). The generic update path has no equivalent gate for credential-bearing payloads.
This issue was originally tracked in the private repository. Migrated by @stianst.
Source: keycloak/keycloak