CVE-2022-1245: Keycloak vulnerable to privilege escalation on Token Exchange feature
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.59633%
CWE
Published
4/26/2022
Updated
6/27/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.keycloak:keycloak-services | maven | < 18.0.0 | 18.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from missing authorization checks in three key areas: 1) Token exchange logic in DefaultTokenExchangeProvider allowed clients to exchange tokens not intended for them due to insufficient validation of token ownership/audience. 2) ClientPermissions' canExchangeTo had a bypass for same-client exchanges. 3) User impersonation checks in UserPermissions lacked client context validation. The patch added checks for token holder matching, audience validation, and client-aware impersonation policies, directly addressing these gaps.