CVE-2022-1245 Keycloak vulnerable to privilege escalation on Token Exchange feature

Critical 9.8 Published Updated

A missing authorization flaw in Keycloak's token exchange allows clients to gain unauthorized access to additional services by specifying arbitrary target client IDs.

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

What is CVE-2022-1245?

CVE-2022-1245 is a critical missing authorization vulnerability in Redhat Keycloak, published on 7 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A privilege escalation flaw was found in the token exchange feature of keycloak. Missing authorization allows a client application holding a valid access token to exchange tokens for any target client by passing the client_id of the target. This could allow a client to gain unauthorized access to additional services.

Weakness: CWE-639, CWE-862

Which versions are affected by CVE-2022-1245?

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

PackageAffectedFixed in
org.keycloak:keycloak-services MavenAll versions18.0.0
org.keycloak:keycloak-services MavenAll versions18.0.0
Linux distribution packages (4)
rh-sso7-keycloak Red Hat:red_hat_single_sign_on:7.5::el7All versions0:15.0.6-1.redhat_00002.1.el7sso
rh-sso7-keycloak-server Red Hat:red_hat_single_sign_on:7.5::el7All versions0:15.0.6-1.redhat_00002.1.el7sso
rh-sso7-keycloak Red Hat:red_hat_single_sign_on:7.5::el8All versions0:15.0.6-1.redhat_00002.1.el8sso
rh-sso7-keycloak-server Red Hat:red_hat_single_sign_on:7.5::el8All versions0:15.0.6-1.redhat_00002.1.el8sso

Products include Redhat Keycloak.

How do I fix CVE-2022-1245?

Upgrade org.keycloak:keycloak-services to 18.0.0 or later.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2022-1245 being exploited?

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

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-75p6-52g3-rqc8, RHSA-2022:1711, RHSA-2022:1712.

Is CVE-2022-1245 in your software?

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

Check your SBOMs for free