CVE-2026-16100: Keycloak-services: keycloak-services: unbounded metric cardinality in user event metrics via request-controlled error text
A denial of service vulnerability was discovered in Keycloak metrics implementation. When user-event metrics are enabled, the EventMetricsProvider records the verbatim error message from failed account operations as a Prometheus metric label. The account consent endpoint specifically embeds caller-supplied input, such as nonexistent client IDs or invalid scope names, directly into these error messages. An authenticated attacker with manage-account or manage-consent permissions can exploit this by repeatedly calling the account consent delete endpoint with unique, randomized client ID values. Each request results in a distinct error message and a corresponding new Prometheus metric time series. This leads to unbounded metric cardinality, which can exhaust the memory of both the Keycloak instance and the connected monitoring system, resulting in a denial of service and degradation of metrics availability.
Other sources
A flaw was found in the user-event metrics recording of Keycloak. When metrics are enabled, the system records raw error messages from failed account operations as Prometheus metric labels. Because these error messages can include user-supplied input like nonexistent client IDs, an authenticated user can create a massive number of unique metric entries, eventually exhausting system memory and causing the service to crash or become unavailable.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Disable Keycloak user-event metrics because failed account operations record the verbatim error message (including caller-supplied input like nonexistent client IDs/invalid scope names) as a Prometheus metric label, creating unbounded metric cardinality that can exhaust memory and crash the service.
Keycloak user-event metrics (EventMetricsProvider / metrics) user-event metrics enabled = disabled - Compensating control
If you must keep metrics enabled temporarily, prevent untrusted authenticated users from calling the account consent delete endpoint (e.g., restrict manage-account/manage-consent permissions via role mapping) to stop repeated requests with randomized client ID values that drive unbounded metric cardinality.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-16100?
The severity of CVE-2026-16100 is medium with a score of 6.5.
How does CVE-2026-16100 affect Keycloak services?
CVE-2026-16100 affects Keycloak services by allowing unbounded metric cardinality due to the recording of raw error messages as Prometheus metric labels.
Who is impacted by CVE-2026-16100?
Authenticated users of Keycloak services are impacted by CVE-2026-16100, specifically during failed account operations.
What is the risk level associated with CVE-2026-16100?
CVE-2026-16100 is classified with a risk level of 38, indicating a notable security concern.
How can organizations mitigate CVE-2026-16100?
Organizations can mitigate CVE-2026-16100 by ensuring that sensitive data is not included in error messages and limiting the exposure of user-supplied input in metrics.