CVE-2026-4629: Keycloak: keycloak: privilege escalation through hardcoded role mapper injection

Published Mar 23, 2026
·
Updated

A flaw was found in Keycloak. A highly privileged user with manage-clients permission can exploit this vulnerability by injecting a hardcoded role mapper into any client. This action allows the user to bypass existing scope restrictions and inject the realm-admin role into generated tokens, resulting in privilege escalation and full administrative access to the realm.

Other sources

A user with manage-clients permission can escalate to realm-admin by injecting a hardcoded role mapper into any client. The mapper injects realm-admin into tokens at generation time, bypassing scope restrictions.

Steps to reproduce:

1. Create a user with only manage-clients role (no user/role/realm access) 2. As attacker, add oidc-hardcoded-role-mapper to any client with config: {"role": "realm-management.realm-admin"} 3. Authenticate through that client 4. Token is generated with realm-admin role injected (bypasses fullScopeAllowed: false) 5. Use token to call admin API — full realm-admin access confirmed

Red Hat

Affected Software

2 affected components
Keycloak Keycloak
redhat Build Of Keycloak

Event History

Mar 23, 2026
Data Sourced
via Red Hat·08:02 AM
DescriptionSeverityAffected Software
Jun 30, 2026
CVE Published
via MITRE·12:00 PM
Data Sourced
via MITRE·12:00 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:18 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-4629?

The severity of CVE-2026-4629 is classified as medium with a score of 6.5.

2

What is CVE-2026-4629 about?

CVE-2026-4629 is a privilege escalation vulnerability in Keycloak that allows a highly privileged user to inject a hardcoded role mapper into clients.

3

How do I fix CVE-2026-4629?

To fix CVE-2026-4629, ensure that highly privileged users do not have the unnecessary ability to manage clients or limit their permissions as needed.

4

Who is affected by CVE-2026-4629?

CVE-2026-4629 affects installations of Keycloak where highly privileged users have the ability to manage clients.

5

What impact does CVE-2026-4629 have on Keycloak security?

The impact of CVE-2026-4629 allows an attacker to bypass scope restrictions and potentially gain elevated privileges by injecting the realm-admin role into tokens.

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