Skip to content
Heist/ feed
Back to feed
Medium

Keycloak: session takeover with oidc offline refreshtokens

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-3916
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 02:40 UTC · Revision 1

Source evidence

Keycloak: session takeover with oidc offline refreshtokens

core-osv · Original source

Published 20 Sept 2023, 14:28 UTC

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.

osv:CVE-2022-3916
Complete source record
{
  "id": "f4935091d7105258c21c122807198399ec5fa904c51a6718b1392a9ae3cf99c3",
  "url": "https://osv.dev/vulnerability/CVE-2022-3916",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "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.",
    "evidence": "osv:CVE-2022-3916",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-3916",
      "aliases": [
        "CVE-2022-3916",
        "GHSA-97g8-xfvw-q4hg"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/keycloak/keycloak",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "e6ece3318230d73a86ee0e6bdd7bb004fa6c264f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:redhat:keycloak:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "20.0.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.4.0.Test",
            "1.3.0.Final",
            "1.1.0.Beta2",
            "1.0.0.Final",
            "1.0-final",
            "1.0-rc-1",
            "1.0-beta-4",
            "1.0-beta-2",
            "1.0-beta-1",
            "1.0-alpha-3",
            "1.0-alpha-2",
            "1.0-alpha-1",
            "1.0-alpha-1-12062013"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-3916.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.694820456Z",
      "provider": "osv",
      "references": [
        "https://access.redhat.com/downloads/content/package-browser/",
        "https://access.redhat.com/jbossnetwork/restricted/listSoftware.html",
        "https://catalog.redhat.com/software/containers/",
        "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://github.com/CVEProject/cvelistV5/tree/main/cves/2022/3xxx/CVE-2022-3916.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-3916",
        "https://bugzilla.redhat.com/show_bug.cgi?id=2141404"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-384"
        ],
        "cna_assigner": "redhat",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "0:18.0.3-1.redhat_00002.1.el7sso"
                  },
                  {
                    "fixed": "0:18.0.6-1.redhat_00001.1.el7sso"
                  },
                  {
                    "fixed": "0:18.0.3-1.redhat_00002.1.el8sso"
                  },
                  {
                    "fixed": "0:18.0.6-1.redhat_00001.1.el8sso"
                  },
                  {
                    "fixed": "0:18.0.3-1.redhat_00002.1.el9sso"
                  },
                  {
                    "fixed": "0:18.0.6-1.redhat_00001.1.el9sso"
                  },
                  {
                    "fixed": "7.6-15"
                  },
                  {
                    "fixed": "7.6-20"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "InverseAffectedRanges"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/3xxx/CVE-2022-3916.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-3916",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 499766,
  "published_at": "2023-09-20T14:28:52.089+00:00"
}