CVE-2026-97848 in Keycloakinfo

Summary

by MITRE • 11/06/2026

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.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/06/2026

The vulnerability identified in Keycloak stems from a critical deficiency in the token sanitization logic specifically affecting protocol mappers configured to emit structured claims using the JSON type. In identity and access management systems like Keycloak, protocol mappers are responsible for transforming internal user attributes into tokens such as JWTs or SAML assertions that can be consumed by relying parties. When these mappers output data in a complex structure rather than simple strings, they often utilize serialization libraries like Jackson to handle JSON objects. The security mechanism intended to enforce authorization policies relies on filtering out unauthorized role mappings before the token is finalized and issued to the client. However, this sanitization routine was implemented with an overly narrow scope that only inspects standard Java Map implementations. It fails to traverse or validate structures instantiated via Jackson-based JSON object representations. This discrepancy creates a blind spot where malicious actors can bypass the intended access control checks by exploiting the difference in how these two data types are handled during the serialization and validation phases of token generation.

From an operational perspective, this flaw allows for privilege escalation through role injection. An attacker who has valid credentials or can manipulate client configurations may forge client roles within the security tokens issued to their session. Because the sanitization logic does not recognize Jackson-based JSON objects as potential vectors for unauthorized data, these forged roles are included in the final token without being stripped out. When this compromised token is presented to a protected resource that trusts Keycloak's assertions, the resource interprets the injected roles as legitimate and authorized. This leads directly to unauthorized access to sensitive resources, potentially exposing confidential data or allowing actions that should be restricted to higher-privileged users. The impact is particularly severe in environments where fine-grained role-based access control is critical for security compliance and data integrity.

This vulnerability aligns with CWE-284 Improper Access Control, as the system fails to properly restrict user access to resources based on their assigned roles. It also relates to CWE-798 Use of Hard-coded Credentials if the exploitation involves manipulating client configurations that were previously secured but are now bypassed due to this logic flaw. In terms of offensive security frameworks, this behavior is consistent with ATT&CK technique T1078 Valid Accounts, where an attacker leverages legitimate credentials and manipulates authentication artifacts to gain unauthorized access. The specific mechanism of exploiting serialization differences or type confusion in validation routines can also be categorized under CWE-20 Improper Input Validation, as the system does not adequately validate the structure and content of all possible input types during the sanitization process.

To mitigate this risk, immediate action is required to update Keycloak installations to a version where the token sanitization logic has been patched to recognize and properly filter Jackson-based JSON objects in addition to standard Java maps. Administrators should verify that their protocol mappers are configured securely and review any custom extensions or configurations that might interact with token generation processes. It is also advisable to implement strict validation on relying parties to ensure they do not blindly trust role claims without additional verification, although the primary fix must reside within the identity provider itself. Regular auditing of access control policies and continuous monitoring for anomalous authentication patterns can help detect potential exploitation attempts while patches are being deployed across the infrastructure.

Responsible

Redhat

Reservation

09/25/2026

Disclosure

11/06/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!