CVE-2025-2559 Org.keycloak/keycloak-services: jwt token cache exhaustion leading to denial of service (dos) in keycloak

Medium 4.9 Published Updated

Attackers can cause denial of service in Keycloak by exhausting JWT token cache memory if long-expiration tokens are used.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-2559?

CVE-2025-2559 is a medium-severity denial of service vulnerability in Red Hat Build of Keycloak, published on 25 Mar 2025. An attacker needs administrator access to exploit it, with no action from the victim.

Official 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.

Weakness: CWE-770

Which versions are affected by CVE-2025-2559?

2 open source packages ship an affected version, including org.keycloak:keycloak-services.

PackageAffectedFixed in
org.keycloak:keycloak-services MavenAll versions to 26.1.4None
org.keycloak:keycloak-services MavenAll versions to 26.1.4None

How do I fix CVE-2025-2559?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-2559 being exploited?

There is no known exploitation of CVE-2025-2559 in the wild and no public exploit code.

Sources

Also known as ECHO-8712-b79a-9acd, GHSA-2935-2wfm-hhpv.

Is CVE-2025-2559 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free