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

Published Nov 9, 2022
·
Updated

A flaw was found in the offlineaccess 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.

Other sources

An issue was discovered in Keycloak when using a client with the offlineaccess scope. Reuse of session ids across root and user authentication sessions and a lack of root session validation enabled attackers to resolve a user session attached to a different previously authenticated user.

This issue most affects users of shared computers. Suppose a user logs out of their account (without clearing their cookies) in a mobile app or similar client that includes the offlineaccess scope, and another user authenticates to the application. In that case, it will share the same root session id, and when utilizing the refresh token, they will be issued a token for the original user.

An issue was discovered in Keycloak when using a client with the offlineaccess scope. Reuse of session ids across root and user authentication sessions and a lack of root session validation enabled attackers to resolve a user session attached to a different previously authenticated user.

This issue most affects users of shared computers. Suppose a user logs out of their account (without clearing their cookies) in a mobile app or similar client that includes the offlineaccess scope, and another user authenticates to the application. In that case, it will share the same root session id, and when utilizing the refresh token, they will be issued a token for the original user.

Red Hat

Affected Software

22 affected componentsFixes available
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00002.1.el7
0:18.0.3-1.redhat_00002.1.el7
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el7
0:18.0.6-1.redhat_00001.1.el7
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00002.1.el8
0:18.0.3-1.redhat_00002.1.el8
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el8
0:18.0.6-1.redhat_00001.1.el8
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00002.1.el9
0:18.0.3-1.redhat_00002.1.el9
redhat/rh-sso7-keycloak<0:18.0.6-1.redhat_00001.1.el9
0:18.0.6-1.redhat_00001.1.el9
maven/org.keycloak:keycloak-parent<=19.0.2
20.0.2
redhat/keycloak<20.0.2
20.0.2
redhat keycloak<20.0.2
redhat Single Sign-on
redhat Single Sign-on=7.6
redhat Enterprise Linux=7.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat OpenShift Container Platform=4.9
redhat OpenShift Container Platform=4.10
redhat Openshift Container Platform For Linuxone=4.9
redhat Openshift Container Platform For Linuxone=4.10
redhat Openshift Container Platform For Power=4.9
redhat Openshift Container Platform For Power=4.10
redhat Openshift Container Platform Ibm Z Systems=4.9
redhat Openshift Container Platform Ibm Z Systems=4.10

Event History

Nov 9, 2022
CVE Published
12:00 AM
Dec 13, 2022
Advisory Published
07:44 PM
Sep 20, 2023
CVE Published
via MITRE·02:28 PM
Data Sourced
via MITRE·02:28 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-3916?

CVE-2022-3916 is a vulnerability in Keycloak that allows attackers to resolve a user session attached to a different previously authenticated user.

2

What is the severity of CVE-2022-3916?

CVE-2022-3916 has a severity rating of 6.8 (medium).

3

How does CVE-2022-3916 affect Keycloak users?

CVE-2022-3916 affects Keycloak users who are using a client with the `offline_access` scope.

4

How can I fix CVE-2022-3916?

To fix CVE-2022-3916, users should apply the recommended patch or upgrade their Keycloak version to 20.0.2.

5

Where can I find more information about CVE-2022-3916?

More information about CVE-2022-3916 can be found on the CVE website (https://www.cve.org/CVERecord?id=CVE-2022-3916) and the NIST NVD (https://nvd.nist.gov/vuln/detail/CVE-2022-3916).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203