CVE-2026-97848: Keycloak-services: keycloak-services: protocol mapper with jsontype=json bypasses token sanitization

Published Sep 25, 2026
·
Updated

A flaw was found in Keycloaks token sanitization mechanism, which was originally implemented to prevent role forgery. The sanitizer responsible for removing unauthorized resource access claims from tokens only performs a type check for java.util.Map. When a protocol mapper is configured with jsonType=JSON, the resulting value is a Jackson ObjectNode, which bypasses this specific type check. An attacker with client registration privileges or a valid Initial Access Token can exploit this by registering a client with a protocol mapper targeting the resource access claim. By setting the mapper to use the JSON type, the attacker can inject arbitrary client roles into the issued tokens. Successful exploitation allows an attacker to forge administrative roles, which are then accepted by resource servers or relying parties that perform authorization based on the resource access claim.

Other sources

A flaw was found in the token sanitization logic of Keycloak, an open source identity and access management solution. The issue occurs when a protocol mapper is configured to emit structured claims using the JSON type. The security check designed to remove unauthorized role mappings only looks for standard Java maps and fails to recognize Jackson based JSON objects. This allows an attacker to inject forged client roles into security tokens, which could lead to unauthorized access to protected resources.

— MITRE

Affected Software

1 affected component
Red Hat Keycloak

Event History

Sep 25, 2026
Data Sourced
via Red Hat·06:25 AM
DescriptionSeverityAffected Software
Nov 6, 2026
CVE Published
via MITRE·06:03 AM
Data Sourced
via MITRE·06:03 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 AM
DescriptionSeverityWeakness

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