CVE-2026-18215: Keycloak-services: keycloak-services: microsoft external access-token exchange bypasses configured tenant

Published Jul 29, 2026
·
Updated

A flaw was found in the Microsoft social identity provider in Keycloak. When a Microsoft identity provider is configured with a specific tenant ID, the restriction is correctly enforced for standard browser-based logins. However, the external access-token exchange endpoint fails to perform this validation. The root cause is that Keycloak calls the tenant-agnostic Microsoft Graph /me endpoint during the exchange process. It accepts the returned user profile and issues Keycloak tokens without verifying that the tenant associated with the original Microsoft token matches the configured tenant ID in the identity provider settings. An attacker with a valid Microsoft Graph access token from an arbitrary tenant can submit it to the Keycloak token exchange endpoint. Successful exploitation allows the attacker to bypass tenant restrictions, assume an identity within the Keycloak realm, and perform actions with the privileges of that identity, such as accessing protected resources or modifying user data.

Other sources

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.

MITRE

Affected Software

3 affected components
Microsoft Keycloak social identity provider in Keycloak (Microsoft external identity provider)
keycloak-services
redhat Build Of Keycloak

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Disable or block the Keycloak token exchange endpoint that performs external access-token exchange using Microsoft tokens, until the tenant-validation bypass is fixed.

  2. Operational

    Review Keycloak realm logs/audit trails for any tokens issued via the Microsoft external access-token exchange endpoint from the affected Keycloak-services component, and revoke/rotate any impacted sessions or credentials.

Event History

Jul 29, 2026
Data Sourced
via Red Hat·08:47 AM
DescriptionSeverityAffected Software
Jul 31, 2026
CVE Published
via MITRE·06:48 AM
Data Sourced
via MITRE·06:48 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-18215?

CVE-2026-18215 has a medium severity score of 6.8.

2

How do I fix CVE-2026-18215?

To fix CVE-2026-18215, ensure that the latest security updates for the Microsoft Keycloak social identity provider are applied.

3

What is the impact of CVE-2026-18215?

CVE-2026-18215 allows an external access-token exchange to bypass the configured tenant restrictions for Microsoft identity providers.

4

Who is affected by CVE-2026-18215?

CVE-2026-18215 affects users of the Keycloak service that utilizes the Microsoft social identity provider.

5

What does CVE-2026-18215 mean for my Keycloak configuration?

CVE-2026-18215 indicates a vulnerability in the Microsoft external identity provider configuration that may compromise tenant security.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203