Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Network-exploitable via token exchange API; PR:L reflects mandatory valid Microsoft token prerequisite; no availability impact as exploitation grants access, not disruption.
Primary rating from Vendor (redhat).
CVSS VectorNVD
Lifecycle Timeline
6DescriptionNVD
Keycloak provides a way to let users log in using Microsoft accounts while restricting access to a specific organization (tenant). A flaw was discovered where this restriction is ignored when using the token exchange feature. This means an attacker with a valid Microsoft token from a completely different organization could gain access to the Keycloak realm, potentially accessing sensitive data or performing unauthorized actions.
AnalysisAI
Tenant-restriction bypass in Keycloak's Microsoft identity provider integration allows attackers holding any valid Microsoft OAuth token - even from a completely unrelated Azure AD organization - to authenticate into a Keycloak realm via the token exchange feature. Affected deployments include Red Hat Build of Keycloak, Red Hat Single Sign-On 7, and Red Hat JBoss EAP Expansion Pack. With CVSS PR:L reflecting the need for a valid Microsoft credential (trivially obtained by registering a free Azure tenant), successful exploitation grants high confidentiality and integrity impact within the realm. No public exploit or active exploitation has been identified at time of analysis; EPSS sits at 0.19% (9th percentile), consistent with SSVC exploitation=none.
Technical ContextAI
Keycloak implements a Microsoft identity provider (IdP) brokering feature that allows realms to federate Microsoft accounts while enforcing a tenant-level restriction - only accounts from a specified Azure AD organization are permitted. The affected code path is the token exchange flow (RFC 8693), in which an external token is traded for a Keycloak session token. CWE-287 (Improper Authentication) identifies the root cause: the tenant claim validation performed during the standard OAuth login flow is not re-applied when processing an inbound token exchange request. Because token exchange is a distinct Keycloak protocol endpoint, the tenant allowlist check is bypassed entirely. Affected CPEs include cpe:2.3:a:red_hat:red_hat_build_of_keycloak, cpe:2.3:a:red_hat:red_hat_single_sign-on_7, cpe:2.3:a:red_hat:red_hat_jboss_enterprise_application_platform_expansion_pack, and cpe:2.3:a:red_hat:red_hat_data_grid_8.
RemediationAI
The primary remediation is to apply the vendor-released patch per the Red Hat security advisory at https://access.redhat.com/security/cve/CVE-2026-18215; exact fixed versions are not independently confirmed in the available data and should be verified directly against the advisory before deployment. As an immediate compensating control, organizations should disable the token exchange feature in Keycloak realm settings if it is not actively required - this eliminates the vulnerable code path entirely without affecting standard Microsoft IdP login flows, though it will break any integrations that depend on token exchange. A second compensating control is to restrict Keycloak's token exchange endpoint at the network or reverse-proxy layer to known internal service accounts only, limiting the attack surface to trusted callers; this trade-off is that it adds operational complexity and may break legitimate use cases. Audit existing Keycloak access logs for unexpected cross-tenant authentications via the token exchange endpoint as a detection measure.
More in Red Hat Build Of Keycloak
View allAccount takeover in Red Hat Build of Keycloak allows an unauthenticated attacker to abuse the reset-credentials flow in
Account takeover in Keycloak (Red Hat build of Keycloak, Red Hat Single Sign-On 7) arises because the IdP-initiated SAML
Authentication bypass in Red Hat Build of Keycloak (and Red Hat Single Sign-On 7) lets an unauthenticated attacker forge
Privilege escalation in Red Hat Build of Keycloak's Dynamic Client Registration (DCR) grants an attacker with low-privil
Mismatched handling of the HTTP/1 absolute-form request authority in Red Hat build of Quarkus and other affected Red Hat
Authorization bypass in the Keycloak Policy Enforcer allows any authenticated user to circumvent all enforced access con
URI normalization bypass in Keycloak's Authorization Services PathMatcher allows authenticated low-privilege users to re
Privilege escalation in Keycloak's Dynamic Client Registration (DCR) component allows attackers with standard user accou
Token exchange in Keycloak bypasses Google Workspace domain allowlist restrictions, enabling any valid Google account ho
Signature-verification bypass in Keycloak (and Red Hat's Keycloak-based products such as Red Hat Single Sign-On 7 and Re
Session hijacking via SAML assertion replay in Keycloak's SAML broker component allows adjacent-network attackers to aut
Open redirect in Red Hat build of Keycloak permits remote attackers to send victims to attacker-controlled hosts by abus
Same weakness CWE-287 – Improper Authentication
View allSame technique Authentication Bypass
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-51480
GHSA-v8h5-7wp9-qxxv