CVE-2022-3916 Keycloak: session takeover with oidc offline refreshtokens
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-parent Maven | All versions | 20.0.2 |
org.keycloak:keycloak-parent Maven | All versions | 20.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.
Other vulnerabilities in Redhat Keycloak
- CVE-2022-4361 Keycloak vulnerable to cross-site scripting when validating URI-schemes on SAML and OIDC
- CVE-2022-1245 Keycloak vulnerable to privilege escalation on Token Exchange feature
- CVE-2021-20195 keycloak Self Stored Cross-site Scripting vulnerability
- CVE-2019-14910 Keycloak Authentication Error
- CVE-2019-14909 Keycloak Authentication Error
Sources
Also known as GHSA-97g8-xfvw-q4hg.