CVE-2026-12388
Awaiting Analysis Awaiting Analysis - Queue

Hardcoded Role Mapper Privilege Escalation in Keycloak

Vulnerability report for CVE-2026-12388, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-30

Last updated on: 2026-06-30

Assigner: Red Hat, Inc.

Description

A flaw was found in the Identity Provider (IdP) mapper component of Keycloak, which is used to manage how user information from external services is mapped to Keycloak users. An administrator with limited permissions to manage identity providers can exploit this flaw by creating a "Hardcoded Role" mapper that assigns high-level administrative roles (like realm-admin) to themselves or others. This allows a restricted administrator to bypass security checks and gain full control over the entire realm.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-30
Last Modified
2026-06-30
Generated
2026-06-30
AI Q&A
2026-06-30
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
redhat keycloak *

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-266 A product incorrectly assigns a privilege to a particular actor, creating an unintended sphere of control for that actor.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-12388 is a privilege escalation vulnerability in Keycloak's Identity Provider (IdP) mapper component. It allows an administrator with limited permissions to manage identity providers to create a "Hardcoded Role" mapper that assigns high-level administrative roles, such as realm-admin, to themselves or others. This happens because the IdP mapper endpoint fails to enforce the required authorization checks, enabling the attacker to bypass security controls and gain full control over the entire realm.

Impact Analysis

This vulnerability can lead to a significant security impact by allowing a delegated administrator with limited permissions to escalate their privileges to full realm administrator. This means the attacker can gain complete control over the Keycloak realm, potentially managing all users, roles, and configurations, which could lead to unauthorized access, data breaches, and disruption of services.

Detection Guidance

Detection of this vulnerability involves identifying if an administrator with limited permissions has created a "Hardcoded Role" mapper in the Keycloak Identity Provider (IdP) configuration that assigns high-level roles such as realm-admin.

You can inspect the Keycloak server configuration, especially the identity provider mappers, to check for any unauthorized or suspicious "Hardcoded Role" mappers.

Since the vulnerability involves the creation of a mapper that assigns elevated roles, commands or API calls to list identity providers and their mappers can help detect this.

For example, using Keycloak's Admin REST API, you can list identity providers and their mappers with commands like:

  • curl -X GET -H "Authorization: Bearer <admin-token>" https://<keycloak-server>/auth/admin/realms/<realm>/identity-provider/instances
  • curl -X GET -H "Authorization: Bearer <admin-token>" https://<keycloak-server>/auth/admin/realms/<realm>/identity-provider/instances/<idp-alias>/mappers

Review the output for any mappers of type "Hardcoded Role" that assign high privilege roles like realm-admin.

Mitigation Strategies

Immediate mitigation steps include restricting the manage-identity-providers permission to only fully trusted administrators, as the vulnerability can be exploited by any administrator with this permission.

Audit existing identity provider mappers for any unauthorized "Hardcoded Role" mappers that assign high-level roles and remove or correct them.

Apply any available patches or updates from Keycloak or your vendor that address this vulnerability.

Monitor administrative actions related to identity providers and mappers to detect suspicious activity.

Compliance Impact

This vulnerability allows a restricted administrator to escalate privileges to full realm administrator by exploiting a flaw in the Identity Provider mapper component of Keycloak. Such unauthorized privilege escalation can lead to unauthorized access to sensitive user data and administrative functions.

Because of this, organizations using affected versions of Keycloak may face increased risk of data breaches or unauthorized data manipulation, which can impact compliance with standards and regulations like GDPR and HIPAA that require strict access controls and protection of personal and sensitive information.

Failure to prevent such privilege escalation could result in violations of these regulations, potentially leading to legal penalties, loss of trust, and other compliance-related consequences.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-12388. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart