CVE-2022-1245: Privilege Escalation in Keycloak Token Exchange Feature

Summary

26/04/2022
Yes i
Critical
9.8

CVE-2022-1245: Keycloak vulnerable to privilege escalation on Token Exchange feature. Affects org.keycloak:keycloak-services versions < 18.0.0. Fixed in 18.0.0. 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 provides authentication and authorization services for applications. It allows clients to obtain and exchange tokens for accessing various services. The token exchange feature enables clients to exchange tokens for other clients. However, a vulnerability has been discovered in this feature that allows a client with a valid access token to perform privilege escalation by exchanging tokens for any target client without proper authorization. This can lead to unauthorized access to additional services.

Vulnerability Detail

The privilege escalation vulnerability in Keycloak's token exchange feature arises from missing authorization checks. A client application holding a valid access token can exploit this flaw by passing the client_id of the target client during token exchange. This allows the client to gain unauthorized access to services intended for the target client. The impact of this vulnerability is critical, as it enables an attacker to bypass access controls and potentially compromise sensitive data or perform unauthorized actions.

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

18.0.0

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

There is no known workaround for this vulnerability. It is essential to apply the recommended fix by upgrading Keycloak to the fixed version.

Conclusion

The privilege escalation vulnerability in Keycloak's token exchange feature can lead to unauthorized access to additional services. It is crucial to upgrade Keycloak to the fixed version (18.0.0 or later) to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.keycloak:keycloak-services →

Share this vulnerability

FAQ

Keycloak is an open-source identity and access management solution that provides authentication and authorization services for applications.

The token exchange feature in Keycloak allows clients to exchange tokens for accessing various services. It enables clients to obtain tokens for other clients.

Privilege escalation refers to the act of gaining higher privileges or access rights than originally intended or authorized. In the context of this vulnerability, it means a client can gain unauthorized access to services intended for another client.

The impact of this vulnerability is critical. It allows an attacker to bypass access controls and gain unauthorized access to additional services, potentially compromising sensitive data or performing unauthorized actions.

To fix this vulnerability, you need to upgrade Keycloak to version 18.0.0 or later. Update the Keycloak dependency in your project's Maven configuration (pom.xml) to the fixed version.

Related vulnerabilities

Recent vulnerabilities recorded for org.keycloak:keycloak-services.

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

18.0.0

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