KeycloakApplication · Redhat

CVE-2024-7341

HIGH · 7.1 CVSS v3.1 Published 2024-09-09
Fix available
A fix is available. Upgrade to 7.6.10 / 22.0.12 or later.
See remediation →
75/100
Remediation priority · High
Remotely reachable

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
A session fixation issue was discovered in the SAML adapters provided by Keycloak. The session ID and JSESSIONID cookie are not changed at login time, even when the turnOffChangeSessionIdOnLogin option is configured. This flaw allows an attacker who hijacks the current session before authentication to trigger session fixation.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

Session fixation vulnerability in Keycloak's SAML adapters where session IDs and JSESSIONID cookies are not rotated upon SAML login, even when the turnOffChangeSessionIdOnLogin option is explicitly configured. An attacker can pre-establish a known session ID before user authentication and subsequently hijack the authenticated session.

MitigationApply Keycloak security updates/patches that address session ID regeneration in SAML adapters; ensure turnOffChangeSessionIdOnLogin is not used in production SAML deployments.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
KeycloakApplication
Affected:<= 25.0.2
Single Sign OnApplication
Affected:>= 7.6, < 7.6.10all versions
Build Of KeycloakApplication
Affected:>= 22.0, < 22.0.12>= 24.0, < 24.0.7

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
High
Privileges
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify SAML adapter deployment
    Locate SAML adapter configuration files in your Keycloak deployment. Check for keycloak-saml.xml, adapter config, or SAML-related subsystem configurations in standalone.xml/standalone-ha.xml. Search for elements like <saml> or SAML-specific adapter JARs in the deployment.
    Affected if SAML adapter is deployed and configured for authentication
  2. Check Keycloak product version
    Run 'keycloak --version' or check the server version via admin console at /realms/master/. Also check RPM package version via 'rpm -qa | grep keycloak' on RH systems. Compare against affected versions: Keycloak <= 25.0.2, RH SSO >= 7.6 to < 7.6.10, RHBOK >= 22.0 to < 22.0.12 or >= 24.0 to < 24.0.7
    Affected if Installed version falls within the affected ranges listed
  3. Inspect turnOffChangeSessionIdOnLogin setting
    Search SAML adapter configuration files for the parameter 'turnOffChangeSessionIdOnLogin'. This parameter is found in keycloak-saml.xml or equivalent adapter config under the <SP> element.
    Affected if turnOffChangeSessionIdOnLogin is explicitly set to true, or is not set (default behavior does not rotate session ID in affected versions)
  4. Verify JSESSIONID cookie behavior
    Clear browser cookies, capture the initial JSESSIONID value before SAML login, perform SAML authentication, then check if a new JSESSIONID cookie value is issued after successful login. Compare the cookie value before and after authentication.
    Affected if The JSESSIONID value remains identical before and after SAML authentication (session is not rotated)
  5. Review SAML assertion for session index
    Examine the SAML response from the Identity Provider after login. Check if a new session index is being generated and if the adapter is binding a new server-side session to the authenticated principal.
    Affected if Session index in SAML response is not being used to establish a new session, or server session ID is not regenerated

You are affected if you use a SAML adapter with an affected Keycloak/RH SSO/RHBOK version AND observe that the JSESSIONID cookie value is not rotated after SAML authentication completes.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 7.6.10 / 22.0.12 / 24.0.7 or later
Fixed in 7.6.1022.0.1224.0.7
Interim mitigation

Apply Keycloak security updates/patches that address session ID regeneration in SAML adapters; ensure turnOffChangeSessionIdOnLogin is not used in production SAML deployments.

Recommended fix High confidence

Keycloak 25.0.3+ | RH-SSO 7.6.10+ | Build of Keycloak 22.0.12+ / 24.0.7+

  1. 1. Identify the exact Keycloak variant in use (Keycloak, Red Hat Single Sign-On, or Build of Keycloak)
  2. 2. For Keycloak: Upgrade to version 25.0.3 or later
  3. 3. For Red Hat Single Sign-On: Upgrade to version 7.6.10 or later
  4. 4. For Build Of Keycloak (22.x line): Upgrade to version 22.0.12 or later
  5. 5. For Build Of Keycloak (24.x line): Upgrade to version 24.0.7 or later
  6. 6. After upgrade, verify the session fixation protection is working by checking that JSESSIONID changes upon SAML login

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Keycloak Scoped from the published advisory
  • Consultation4.0 h
  • Implementation12.0 h
  • Testing8.0 h
  • Review / QA4.0 h
28.0 hours of engineering $4,880
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $7,808.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-7341 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-7341 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data