CVE-2022-3916 Keycloak: session takeover with oidc offline refreshtokens

Medium 6.8 Published Updated

Attackers can hijack user sessions via offline refresh tokens due to missing root session validation, leading to account takeover.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-3916?

CVE-2022-3916 is a medium-severity authentication bypass vulnerability in Redhat Keycloak, published on 20 Sep 2023. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

A flaw was found in the offline_access scope in Keycloak. This issue would affect users of shared computers more (especially if cookies are not cleared), due to a lack of root session validation, and the reuse of session ids across root and user authentication sessions. This enables an attacker to resolve a user session attached to a previously authenticated user; when utilizing the refresh token, they will be issued a token for the original user.

Weakness: CWE-613, CWE-384

Which versions are affected by CVE-2022-3916?

2 open source packages ship an affected version, including org.keycloak:keycloak-parent. It affects 6 products.

PackageAffectedFixed in
org.keycloak:keycloak-parent MavenAll versions20.0.2
org.keycloak:keycloak-parent MavenAll versions20.0.2

Products include Redhat Keycloak, Redhat Openshift Container Platform, Redhat Openshift Container Platform for Linuxone, Redhat Openshift Container Platform for Power, Redhat Openshift Container Platform Ibm Z Systems, Redhat Single Sign-On.

How do I fix CVE-2022-3916?

Upgrade org.keycloak:keycloak-parent to 20.0.2 or later.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2022-3916 being exploited?

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

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-97g8-xfvw-q4hg.

Is CVE-2022-3916 in your software?

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

Check your SBOMs for free