CVE-2026-9704: Keycloak Server SPI and Services Privilege Escalation Due to Improper Token Validation

Summary

27/05/2026
Yes i
Moderate
6.8

CVE-2026-9704: Keycloak Vulnerable to Improper Validation of Specified Quantity in Input. Affects org.keycloak:keycloak-server-spi-private versions < 26.6.3. Fixed in 26.6.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Keycloak is an open-source identity and access management solution that allows users to secure applications and services with little to no code. It provides features such as single sign-on, identity brokering, and user federation. The Keycloak Server SPI (Service Provider Interface) and Keycloak Services are essential components that facilitate the integration and management of authentication and authorization processes. However, a vulnerability has been identified that affects these components, allowing for potential privilege escalation.

Vulnerability Detail

A flaw exists in Keycloak where an authenticated user with low privileges can exploit the system by sending an oversized subject_token JSON Web Token (JWT) to the TokenEndpoint. If the token exceeds a 4000-character limit, it is silently dropped, causing the system to revert to client credentials. This behavior allows the user to gain the permissions of the client's service account, leading to unauthorized access and privilege escalation. The vulnerability is classified under CWE-1284, indicating improper validation of specified quantity in input.

How To Fix

Latest published version: 26.8.1 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

26.6.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, consider implementing input validation on the client-side to ensure that the size of the JWT does not exceed the acceptable limit. Additionally, monitor the TokenEndpoint for unusual activity that may indicate exploitation attempts.

Conclusion

In summary, CVE-2026-9704 is a significant vulnerability in Keycloak that can lead to privilege escalation due to improper validation of JWT tokens. It is crucial for users to update to the patched version 26.6.3 to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for org.keycloak:keycloak-server-spi-private →

Share this vulnerability

FAQ

CVE-2026-9704 is a vulnerability in Keycloak that allows an authenticated user with low privileges to escalate their permissions by exploiting improper validation of oversized JWT tokens.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By simply analyzing your pom.xml file, Vulert can help identify if your application is affected by this vulnerability.

If exploited, this vulnerability can allow unauthorized users to gain elevated permissions, potentially leading to data breaches or unauthorized access to sensitive resources.

Update your Keycloak packages to version 26.6.3 or later by modifying your pom.xml file to include the new version for the affected dependencies.

Yes, you can implement input validation on the client-side and monitor the TokenEndpoint for any unusual activity as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for org.keycloak:keycloak-server-spi-private.

How To Fix

Latest published version: 26.8.1 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

26.6.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback