Skip to main content

CVE-2025-2559: Allocation of Resources Without Limits or Throttling

Medium
VulnerabilityCVE-2025-2559cvecve-2025-2559
Published: Tue Mar 25 2025 (03/25/2025, 08:20:57 UTC)
Source: CVE
Vendor/Project: Red Hat
Product: Red Hat Build of Keycloak

Description

A flaw was found in Keycloak. When the configuration uses JWT tokens for authentication, the tokens are cached until expiration. If a client uses JWT tokens with an excessively long expiration time, for example, 24 or 48 hours, the cache can grow indefinitely, leading to an OutOfMemoryError. This issue could result in a denial of service condition, preventing legitimate users from accessing the system.

AI-Powered Analysis

AILast updated: 07/11/2025, 05:46:39 UTC

Technical Analysis

CVE-2025-2559 is a medium-severity vulnerability affecting Red Hat Build of Keycloak versions 23.0.0 through 26.1.0. The flaw arises from the way Keycloak handles JWT tokens when configured for authentication. Specifically, JWT tokens are cached until their expiration time to optimize authentication performance. However, if a client uses JWT tokens with excessively long expiration times (e.g., 24 to 48 hours), the cache can grow without bounds because tokens remain stored until they expire. This unchecked growth can lead to an OutOfMemoryError in the Keycloak server, effectively causing a denial of service (DoS) condition. The DoS prevents legitimate users from accessing authentication services, disrupting dependent applications and services. The vulnerability requires network access (AV:N) and low attack complexity (AC:L), but does require high privileges (PR:H) to exploit, and no user interaction is needed (UI:N). The impact is limited to availability (A:H), with no confidentiality or integrity impact. There are no known exploits in the wild at this time, and no patches are linked yet. The root cause is the lack of limits or throttling on resource allocation related to token caching, which is a classic resource exhaustion issue. This vulnerability highlights the risks of relying on long-lived JWT tokens without proper cache management or token expiration policies.

Potential Impact

For European organizations using Red Hat Build of Keycloak for identity and access management, this vulnerability poses a risk of service disruption. Keycloak is widely used in enterprise environments for single sign-on (SSO) and authentication services. An OutOfMemoryError triggered by unbounded token caching can cause authentication services to become unavailable, leading to denial of service for internal users and customers. This can impact business continuity, especially for organizations with critical online services or regulatory compliance requirements such as GDPR, where availability of authentication services is essential. The disruption could affect sectors like finance, healthcare, government, and telecommunications, where Keycloak is commonly deployed. Additionally, the vulnerability could be exploited internally by privileged users or compromised accounts to degrade service availability. Although exploitation requires high privileges, insider threats or compromised administrative credentials could leverage this flaw. The lack of confidentiality or integrity impact reduces risks of data breaches, but service outages could still cause reputational damage and operational losses.

Mitigation Recommendations

To mitigate CVE-2025-2559, European organizations should implement the following specific measures: 1) Enforce strict token expiration policies by limiting JWT token lifetimes to short durations (e.g., minutes to a few hours) to prevent cache growth. 2) Monitor Keycloak server memory usage and configure alerting for abnormal increases that could indicate cache bloat. 3) Implement cache size limits or eviction policies if configurable, to prevent unbounded growth. 4) Restrict issuance of long-lived tokens to only trusted clients or administrative users. 5) Regularly audit privileged accounts and their token usage to detect misuse. 6) Apply any available patches or updates from Red Hat promptly once released. 7) Consider deploying rate limiting or throttling on authentication requests to reduce risk of resource exhaustion. 8) Use Keycloak’s built-in metrics and logging to track token cache behavior and identify anomalies early. 9) Isolate Keycloak instances in environments with resource limits to contain impact. These steps go beyond generic advice by focusing on token lifecycle management, cache control, and monitoring tailored to this vulnerability’s root cause.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
redhat
Date Reserved
2025-03-20T12:22:59.504Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d983bc4522896dcbee413

Added to database: 5/21/2025, 9:09:15 AM

Last enriched: 7/11/2025, 5:46:39 AM

Last updated: 8/13/2025, 11:33:57 AM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats