<Vulnerability name="CVE-2026-9796">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Moderate</ThreatSeverity>
    <PublicDate>2026-05-28T03:32:50</PublicDate>
    <Bugzilla id="2482464" url="https://bugzilla.redhat.com/show_bug.cgi?id=2482464" xml:lang="en:us">
keycloak: Keycloak: Privilege escalation via Time-of-Check to Time-of-Use (TOCTOU) vulnerability
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>6.5</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-367</CWE>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in Keycloak. An authenticated administrator with the `manage-clients` role can exploit a Time-of-check to time-of-use (TOCTOU) vulnerability in the name-based admin role checks. This allows the attacker to escalate their privileges to `realm-admin` for all users within the realm, granting them extensive control over the system. The composite role relationship persists even after the attacker's own permissions are revoked and across system reboots.
    </Details>
    <Statement xml:lang="en:us">
A Moderate privilege escalation flaw exists in Keycloak where an authenticated administrator with `manage-clients` privileges can exploit a Time-of-Check to Time-of-Use (TOCTOU) vulnerability. This allows them to escalate their privileges to `realm-admin` for all users within the realm, impacting the integrity of role-based access control.
    </Statement>
    <Acknowledgement xml:lang="en:us">
Red Hat would like to thank Daniel Peters (Operating Intelligence Inc.), Lior Moshe (Operating Intelligence Inc.), and Uri Rolls (Operating Intelligence Inc.) 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>
    <PackageState cpe="cpe:/a:redhat:build_keycloak:">
        <ProductName>Red Hat Build of Keycloak</ProductName>
        <FixState>Affected</FixState>
        <PackageName>rhbk/keycloak-rhel9</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-9796
https://nvd.nist.gov/vuln/detail/CVE-2026-9796
    </References>
</Vulnerability>