<Vulnerability name="CVE-2026-97848">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Moderate</ThreatSeverity>
    <PublicDate>2026-11-05T00:00:00</PublicDate>
    <Bugzilla id="2540960" url="https://bugzilla.redhat.com/show_bug.cgi?id=2540960" xml:lang="en:us">
keycloak-services: keycloak-services: Protocol mapper with jsonType=JSON bypasses token sanitization
    </Bugzilla>
    <CVSS3 status="verified">
        <CVSS3BaseScore>6.5</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-20</CWE>
    <Details xml:lang="en:us" source="Mitre">
A flaw was found in the token sanitization logic of Keycloak, an open source identity and access management solution. The issue occurs when a protocol mapper is configured to emit structured claims using the JSON type. The security check designed to remove unauthorized role mappings only looks for standard Java maps and fails to recognize Jackson based JSON objects. This allows an attacker to inject forged client roles into security tokens, which could lead to unauthorized access to protected resources.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in the token sanitization logic of Keycloak, an open source identity and access management solution. The issue occurs when a protocol mapper is configured to emit structured claims using the JSON type. The security check designed to remove unauthorized role mappings only looks for standard Java maps and fails to recognize Jackson based JSON objects. This allows an attacker to inject forged client roles into security tokens, which could lead to unauthorized access to protected resources.
    </Details>
    <Statement xml:lang="en:us">
The Red Hat Product Security team has assessed the severity of this vulnerability as Moderate, given that exploitation requires the attacker to have existing client registration privileges or a valid Initial Access Token. Successful exploitation allows an attacker to forge client-role mappings in signed tokens, potentially leading to unauthorized access to resource servers. The vulnerability's root cause is an incomplete type check in the token sanitization logic that fails to account for Jackson ObjectNode values when jsonType=JSON is used.
    </Statement>
    <Acknowledgement xml:lang="en:us">
Red Hat would like to thank Katika Mohaseen (GitHub: h1-mrz) for reporting this issue.
    </Acknowledgement>
    <Mitigation xml:lang="en:us">
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
    </Mitigation>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.4::el9">
        <ProductName>Red Hat build of Keycloak 26.4</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95760">RHSA-2026:95760</Advisory>
        <Package name="rhbk/keycloak-operator-bundle">rhbk/keycloak-operator-bundle:26.4.17-2</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.4::el9">
        <ProductName>Red Hat build of Keycloak 26.4</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95760">RHSA-2026:95760</Advisory>
        <Package name="rhbk/keycloak-rhel9">rhbk/keycloak-rhel9:26.4-29</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.4::el9">
        <ProductName>Red Hat build of Keycloak 26.4</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95760">RHSA-2026:95760</Advisory>
        <Package name="rhbk/keycloak-rhel9-operator">rhbk/keycloak-rhel9-operator:26.4-30</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.4::el9">
        <ProductName>Red Hat build of Keycloak 26.4.17</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95759">RHSA-2026:95759</Advisory>
        <Package name="keycloak-services">keycloak-services</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.4::el9">
        <ProductName>Red Hat build of Keycloak 26.4.17</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95759">RHSA-2026:95759</Advisory>
        <Package name="rhbk/keycloak-rhel9">rhbk/keycloak-rhel9</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.6::el9">
        <ProductName>Red Hat build of Keycloak 26.6</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95762">RHSA-2026:95762</Advisory>
        <Package name="rhbk/keycloak-operator-bundle">rhbk/keycloak-operator-bundle:26.6.8-2</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.6::el9">
        <ProductName>Red Hat build of Keycloak 26.6</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95762">RHSA-2026:95762</Advisory>
        <Package name="rhbk/keycloak-rhel9">rhbk/keycloak-rhel9:26.6-24</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.6::el9">
        <ProductName>Red Hat build of Keycloak 26.6</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95762">RHSA-2026:95762</Advisory>
        <Package name="rhbk/keycloak-rhel9-operator">rhbk/keycloak-rhel9-operator:26.6-24</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.6::el9">
        <ProductName>Red Hat build of Keycloak 26.6.8</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95761">RHSA-2026:95761</Advisory>
        <Package name="keycloak-services">keycloak-services</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:build_keycloak:26.6::el9">
        <ProductName>Red Hat build of Keycloak 26.6.8</ProductName>
        <ReleaseDate>2026-11-06T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:95761">RHSA-2026:95761</Advisory>
        <Package name="rhbk/keycloak-rhel9">rhbk/keycloak-rhel9</Package>
    </AffectedRelease>
    <PackageState cpe="cpe:/a:redhat:red_hat_single_sign_on:7">
        <ProductName>Red Hat Single Sign-On 7</ProductName>
        <FixState>Not affected</FixState>
        <PackageName>keycloak-services</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-97848
https://nvd.nist.gov/vuln/detail/CVE-2026-97848
    </References>
</Vulnerability>