Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister free Azure AD tenant
-
DeliveryObtain valid Microsoft OAuth token
-
ExploitSubmit token to Keycloak token exchange endpoint
-
ExecutionKeycloak skips tenant restriction check
-
PersistReceive valid Keycloak realm session
-
ImpactAccess protected realm resources
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Authentication mechanism validation
MITRE ATT&CK
2 techniques across 2 tactics: Defense Evasion, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three simultaneous conditions: (1) the Keycloak realm must be configured with a Microsoft identity provider that has a specific-tenant restriction enabled (i.e., the 'Tenant' field in the Microsoft IdP configuration is set to a specific Azure AD organization rather than 'organizations' or 'common'); (2) the Keycloak realm must have the token exchange feature enabled (disabled by default in many configurations and must be explicitly turned on via realm settings); and (3) the attacker must possess any valid Microsoft OAuth token - this can be from a completely different Azure AD organization, including a free tenant the attacker themselves controls. Exploitation is limited to network-accessible Keycloak instances with both conditions active simultaneously. Standard Microsoft IdP login flows that do not use token exchange are NOT affected. Attackers without a Microsoft account cannot exploit this flaw. |
| Impact | The CVSS 8.1 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N) accurately captures the network-accessible, low-complexity nature of exploitation, but the PR:L metric is the key qualifying factor: an attacker must possess a valid Microsoft OAuth token from any Azure AD tenant, which is readily obtainable by creating a free Microsoft account or organization. This lowers the practical barrier significantly. EPSS at 0.19% (9th percentile) and SSVC exploitation=none both indicate no observed active exploitation, making this a theoretical but credible attack path rather than an imminent threat. SSVC technical impact=total and SSVC automatable=no present an interesting contrast - the scope of access is severe if exploited, but the prerequisite of obtaining a valid Microsoft token introduces a manual step that prevents fully automated mass exploitation. The vulnerability is NOT in CISA KEV, and no POC has been identified. This is a real priority for organizations whose Keycloak realms protect sensitive resources and use both Microsoft IdP integration and token exchange simultaneously; for all others, the risk is theoretical. |
| Exploit ScenarioDerived | An attacker registers a free Microsoft Azure AD tenant and obtains a valid Microsoft OAuth access token for their own account. They then send a token exchange request to the target Keycloak instance's token exchange endpoint, submitting this cross-tenant Microsoft token. Because the tenant restriction check is not applied during token exchange, Keycloak issues a valid realm session, granting the attacker access to protected applications and data within the realm. No public POC for this specific flaw has been identified, but the token exchange API is well-documented and the exploitation pattern requires only standard OAuth tooling. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Aug 07, 2026
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.
Earlier versions of this analysis (1)
Tenant restriction bypass in Keycloak's Microsoft social login allows unauthorized cross-organization authentication when the token exchange feature is enabled. Specifically, Keycloak's enforcement of Azure AD organization (tenant) boundaries fails during token exchange flows: an attacker holding any valid Microsoft token - even from an entirely unrelated Azure AD tenant - can authenticate into a Keycloak realm that should be restricted to a specific organization. High confidentiality and integrity impact is confirmed by the CVSS C:H/I:H ratings, though no public exploit code has been identified and the vulnerability is not currently in the CISA KEV catalog.
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.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
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.
Know when Red Hat Build Of Keycloak gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
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
4DescriptionNVD
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.
Executive ViewAI
Red Hat Keycloak, Red Hat Single Sign-On 7, and JBoss EAP Expansion Pack contain a tenant-restriction bypass in Microsoft identity provider integration that allows attackers holding any valid Microsoft OAuth token-even from unrelated Azure AD organizations-to authenticate into affected realms. This security boundary violation exposes multi-tenant deployments to unauthorized access, as attackers need only a free Azure tenant registration to exploit the vulnerability.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable Microsoft identity provider integration if operationally feasible; (2) Implement real-time monitoring and alerting for token exchanges from unauthorized Azure AD tenant IDs; (3) Enforce organization-specific tenant ID restrictions at the Azure AD application registration level; (4) Restrict network access to Keycloak endpoints to trusted IP ranges and clients; (5) Conduct forensic audit of authentication logs (past 60-90 days) to detect prior unauthorized cross-tenant token usage.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)NVD
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
Remote code execution in Keycloak is possible when an authenticated user with client-management permissions creates or i
Keycloak's SAML HTTP-Redirect binding can be tricked into accepting an unsigned, attacker-supplied SAML message: paramet
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
Account takeover in Keycloak's idp-auto-link authenticator lets an attacker who holds an account at a brokered identity
Mismatched handling of the HTTP/1 absolute-form request authority in Red Hat build of Quarkus and other affected Red Hat
Authentication bypass in Keycloak's Organization identity-first login flow allows an authenticated attacker who belongs
Keycloak's UMA Protection API lets an authenticated realm user create a policy whose resourceType is not validated, so t
Authorization bypass in the Keycloak Policy Enforcer allows any authenticated user to circumvent all enforced access con
Keycloak's Dynamic Client Registration feature accepts registration requests in which an authorized registrant can map t
EUVD-2026-51480
GHSA-v8h5-7wp9-qxxv
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB