{"id":"CVE-2022-3916","aliases":["CVE-2022-3916","GHSA-97g8-xfvw-q4hg"],"related":[],"kind":"vulnerability","state":"published","title":"Keycloak: session takeover with oidc offline refreshtokens","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"An issue was discovered in Keycloak when using a client with the `offline_access` 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.\n\nThis 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 `offline_access` 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se encontró una falla en el alcance offline_access en Keycloak. Este problema afectaría más a los usuarios de ordenadores compartidos (especialmente si las cookies no se borran), debido a la falta de validación de la sesión root y a la reutilización de los identificadores de sesión en las sesiones de autenticación de usuario y root. Esto permite a un atacante resolver una sesión de usuario adjunta a un usuario previamente autenticado; al utilizar el token de actualización, se les emitirá un token para el usuario original.","source":"nvd"}],"published":"2022-12-13T19:44:33.000Z","modified":"2026-06-17T05:00:34.417Z","severity":{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-287","CWE-304","CWE-384","CWE-488","CWE-613"],"affected":[{"ranges":[],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7","package":"keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6.1","package":"keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6.1","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.3-1.redhat_00002.1.el7sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 7","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el7","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.6-1.redhat_00001.1.el7sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 7","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el7","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.3-1.redhat_00002.1.el8sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 8","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el8","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.6-1.redhat_00001.1.el8sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 8","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el8","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.3-1.redhat_00002.1.el9sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 9","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:18.0.6-1.redhat_00001.1.el9sso","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Single Sign-On 7.6 for RHEL 9","package":"rh-sso7-keycloak","cpe":"cpe:/a:redhat:red_hat_single_sign_on:7.6::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"7.6-15","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"RHEL-8 based Middleware Containers","package":"rh-sso-7/sso76-openshift-rhel8","cpe":"cpe:/a:redhat:rhosemc:1.0::el8","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"7.6-20","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"RHEL-8 based Middleware Containers","package":"rh-sso-7/sso76-openshift-rhel8","cpe":"cpe:/a:redhat:rhosemc:1.0::el8","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"20.0.2"}],"ecosystem":"Maven","package":"org.keycloak:keycloak-parent","purl":"pkg:maven/org.keycloak/keycloak-parent","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"20.0.2"}],"vendor":"redhat","product":"keycloak","cpe":"cpe:2.3:a:redhat:keycloak:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"7.6"}],"vendor":"redhat","product":"single_sign-on","cpe":"cpe:2.3:a:redhat:single_sign-on:-:*:*:*:text-only:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"4.9"},{"status":"affected","version":"4.10"}],"vendor":"redhat","product":"openshift_container_platform","cpe":"cpe:2.3:a:redhat:openshift_container_platform:4.9:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"4.9"},{"status":"affected","version":"4.10"}],"vendor":"redhat","product":"openshift_container_platform_for_linuxone","cpe":"cpe:2.3:a:redhat:openshift_container_platform_for_linuxone:4.9:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"4.9"},{"status":"affected","version":"4.10"}],"vendor":"redhat","product":"openshift_container_platform_for_power","cpe":"cpe:2.3:a:redhat:openshift_container_platform_for_power:4.9:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"4.9"},{"status":"affected","version":"4.10"}],"vendor":"redhat","product":"openshift_container_platform_ibm_z_systems","cpe":"cpe:2.3:a:redhat:openshift_container_platform_ibm_z_systems:4.9:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://access.redhat.com/errata/RHSA-2022:8961","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8962","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8963","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8964","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8965","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2023:1043","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2023:1044","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2023:1045","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2023:1047","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2023:1049","tags":["vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2022-3916","tags":["vdb-entry","vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2141404","tags":["issue-tracking","vendor-advisory","web","x-refsource-redhat","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/keycloak/keycloak/security/advisories/GHSA-97g8-xfvw-q4hg","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-3916","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/keycloak/keycloak","tags":["package"],"sources":["ghsa"]}],"credits":["Red Hat would like to thank Peter Flintholm (Trifork) for reporting this issue."],"assigner":"redhat","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2024-07-13T20:08:01.880Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-3916","url":"https://www.cve.org/CVERecord?id=CVE-2022-3916","licence":"CVE Terms of Use","modified":"2024-08-03T01:20:58.791Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-97g8-xfvw-q4hg","url":"https://github.com/advisories/GHSA-97g8-xfvw-q4hg","licence":"CC-BY-4.0","modified":"2024-02-16T08:22:58.053Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-3916","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-3916","licence":"Public domain","modified":"2026-06-17T05:00:34.417Z"}],"updatedAt":"2026-11-25T22:58:19.620Z","epss":{"score":0.00952,"percentile":0.62383,"date":"2026-12-02T12:00:21.000Z"}}