REDHAT-BUG-2588703: High severity Red Hat Keycloak Operator vulnerability
A flaw was found in the Keycloak Operator. The vulnerability exists because the KeycloakRealmImport custom resource (CR) allows sensitive realm export data, including client secrets, key-provider secrets, and private keys, to be stored in plaintext within the spec.realm field. In a standard Kubernetes environment, access to Secret objects is strictly controlled; however, permissions to read custom resources are often delegated separately. An attacker with namespaced get permission on keycloakrealmimports.k8s.keycloak.org can retrieve the full CR content, bypassing the lack of access to Kubernetes Secrets. Successful exploitation allows an attacker to recover active reusable client credentials and realm signing or encryption keys, enabling them to impersonate clients, decrypt sensitive data, or gain unauthorized administrative access to the Keycloak realm.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Clusters using the Keycloak Operator are exposed where KeycloakRealmImport resources contain realm export data and users or service accounts have namespaced get permission on keycloakrealmimports.k8s.keycloak.org. Those principals may not need Kubernetes Secret access.
What does an attacker need to exploit it?
An attacker needs permission to read KeycloakRealmImport custom resources in the relevant namespace. Reading the resource can reveal plaintext client secrets, key-provider secrets, and private keys from spec.realm.
What can an attacker do with the recovered data?
Recovered credentials and keys may allow an attacker to impersonate clients, decrypt sensitive data, or obtain unauthorized administrative access to the affected Keycloak realm.
How can I determine whether sensitive data may already be exposed?
Review KeycloakRealmImport resources for sensitive realm export data stored in spec.realm, then review which users and service accounts have namespaced get access to keycloakrealmimports.k8s.keycloak.org. Any such principal could retrieve the full custom resource content.