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 resource allocation vulnerability found in Red Hat Build of Keycloak, specifically when configured to use JWT tokens for authentication. Keycloak caches JWT tokens until their expiration to optimize authentication performance. However, if clients issue JWT tokens with excessively long expiration times (e.g., 24 to 48 hours), the cache can grow indefinitely because tokens remain stored until they expire. This unchecked cache growth consumes increasing amounts of memory, eventually triggering an OutOfMemoryError in the Java runtime environment. The resulting failure causes Keycloak to become unresponsive or crash, leading to a denial of service (DoS) condition that blocks legitimate users from authenticating. The vulnerability requires high privileges to exploit (e.g., the ability to configure or influence token issuance) but does not require user interaction. The flaw impacts availability but does not compromise confidentiality or integrity of data. No public exploits have been reported yet, and no patches are currently linked, indicating the need for proactive configuration management. This issue highlights the importance of setting reasonable JWT token expiration times and implementing resource usage limits or throttling mechanisms within authentication services to prevent resource exhaustion attacks.
Potential Impact
For European organizations, this vulnerability poses a risk of service disruption in identity and access management systems relying on Keycloak, particularly those using JWT tokens with long expiration times. A successful exploitation could cause authentication services to become unavailable, impacting business operations, user productivity, and access to critical applications. Sectors such as finance, healthcare, government, and telecommunications, which often depend on robust authentication infrastructure, could experience significant operational impact. The denial of service could also affect compliance with regulations requiring continuous availability of authentication services. Since the vulnerability does not affect confidentiality or integrity, data breaches are unlikely, but service outages could lead to reputational damage and financial losses. Organizations with large user bases or high authentication traffic are more vulnerable due to the potential for rapid cache growth. The absence of known exploits provides a window for remediation, but the medium severity rating indicates that the threat should not be underestimated.
Mitigation Recommendations
To mitigate CVE-2025-2559, European organizations should: 1) Configure JWT token expiration times to reasonable durations, avoiding excessively long lifetimes (e.g., limit tokens to a few hours rather than days). 2) Monitor Keycloak's memory usage and cache size metrics closely to detect abnormal growth early. 3) Implement resource limits or throttling on token issuance rates to prevent abuse or accidental overload. 4) Regularly update Keycloak to the latest versions where fixes or improvements may be released. 5) Review and restrict privileges related to token configuration and issuance to minimize risk of malicious or misconfigured long-lived tokens. 6) Consider deploying additional caching or token validation layers that can enforce expiration and cleanup policies more aggressively. 7) Conduct load testing to understand the impact of token expiration settings on resource consumption. 8) Prepare incident response plans for potential denial of service scenarios affecting authentication services. These steps go beyond generic advice by focusing on configuration tuning, monitoring, and privilege management specific to this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden
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 resource allocation vulnerability found in Red Hat Build of Keycloak, specifically when configured to use JWT tokens for authentication. Keycloak caches JWT tokens until their expiration to optimize authentication performance. However, if clients issue JWT tokens with excessively long expiration times (e.g., 24 to 48 hours), the cache can grow indefinitely because tokens remain stored until they expire. This unchecked cache growth consumes increasing amounts of memory, eventually triggering an OutOfMemoryError in the Java runtime environment. The resulting failure causes Keycloak to become unresponsive or crash, leading to a denial of service (DoS) condition that blocks legitimate users from authenticating. The vulnerability requires high privileges to exploit (e.g., the ability to configure or influence token issuance) but does not require user interaction. The flaw impacts availability but does not compromise confidentiality or integrity of data. No public exploits have been reported yet, and no patches are currently linked, indicating the need for proactive configuration management. This issue highlights the importance of setting reasonable JWT token expiration times and implementing resource usage limits or throttling mechanisms within authentication services to prevent resource exhaustion attacks.
Potential Impact
For European organizations, this vulnerability poses a risk of service disruption in identity and access management systems relying on Keycloak, particularly those using JWT tokens with long expiration times. A successful exploitation could cause authentication services to become unavailable, impacting business operations, user productivity, and access to critical applications. Sectors such as finance, healthcare, government, and telecommunications, which often depend on robust authentication infrastructure, could experience significant operational impact. The denial of service could also affect compliance with regulations requiring continuous availability of authentication services. Since the vulnerability does not affect confidentiality or integrity, data breaches are unlikely, but service outages could lead to reputational damage and financial losses. Organizations with large user bases or high authentication traffic are more vulnerable due to the potential for rapid cache growth. The absence of known exploits provides a window for remediation, but the medium severity rating indicates that the threat should not be underestimated.
Mitigation Recommendations
To mitigate CVE-2025-2559, European organizations should: 1) Configure JWT token expiration times to reasonable durations, avoiding excessively long lifetimes (e.g., limit tokens to a few hours rather than days). 2) Monitor Keycloak's memory usage and cache size metrics closely to detect abnormal growth early. 3) Implement resource limits or throttling on token issuance rates to prevent abuse or accidental overload. 4) Regularly update Keycloak to the latest versions where fixes or improvements may be released. 5) Review and restrict privileges related to token configuration and issuance to minimize risk of malicious or misconfigured long-lived tokens. 6) Consider deploying additional caching or token validation layers that can enforce expiration and cleanup policies more aggressively. 7) Conduct load testing to understand the impact of token expiration settings on resource consumption. 8) Prepare incident response plans for potential denial of service scenarios affecting authentication services. These steps go beyond generic advice by focusing on configuration tuning, monitoring, and privilege management specific to this vulnerability.
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: 11/20/2025, 9:41:24 PM
Last updated: 11/22/2025, 4:44:14 PM
Views: 56
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2023-30806: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Sangfor Net-Gen Application Firewall
CriticalCVE-2024-0401: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ASUS ExpertWiFi
HighCVE-2024-23690: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Netgear FVS336Gv3
HighCVE-2024-13976: CWE-427 Uncontrolled Search Path Element in Commvault Commvault for Windows
HighCVE-2024-12856: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Four-Faith F3x24
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.