CVE-2025-2559: Allocation of Resources Without Limits or Throttling
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 Analysis
Technical Summary
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.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden, Belgium
CVE-2025-2559: Allocation of Resources Without Limits or Throttling
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
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.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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
Related Threats
CVE-2025-8098: CWE-276: Incorrect Default Permissions in Lenovo PC Manager
HighCVE-2025-53192: CWE-146 Improper Neutralization of Expression/Command Delimiters in Apache Software Foundation Apache Commons OGNL
UnknownCVE-2025-4371: CWE-347: Improper Verification of Cryptographic Signature in Lenovo 510 FHD Webcam
HighCVE-2025-32992: n/a
HighCVE-2025-55591: n/a
CriticalActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.