A flaw was found in the OIDC protocol implementation of Keycloak, an open-source identity and access management solution. The issue occurs during the token refresh process when the server restores requested audiences from stored client IDs. Keycloak fails to verify if the target audience client is still enabled before issuing a new access token. This allows an application with an existing refresh token to continue obtaining valid access tokens for a disabled client, potentially bypassing administrative access controls for resource servers that rely on offline JWT validation.
A Missing Authorization vulnerability was identified in the org.keycloak.protocol.oidc package of Keycloak. The flaw exists in the token refresh logic including standard token exchange refresh flows where the server restores audience claims from the original session without checking the current status of the target audience client via ClientModel.isEnabled. An attacker with a valid refresh token obtained while a target audience client was enabled can continue to refresh that token even after an administrator has disabled the target client. Successful exploitation allows the attacker to obtain newly signed access tokens containing the disabled client in the aud claim. This enables the attacker to maintain unauthorized access to resource servers that perform offline JWT verification, effectively bypassing the administrative action intended to revoke access.