Description
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.
Published: 2026-11-06
Score: 6.5 Medium
EPSS: n/a
KEV: No
Impact: Unauthorized Role Injection via Token Manipulation
Action: Patch Upgrade
AI Analysis

Impact

A flaw was discovered in the token sanitization logic of Keycloak, where role mappings embedded in security tokens are not properly validated when a protocol mapper emits structured claims using a JSON type. The check that removes unauthorized role mappings only targets standard Java maps and ignores Jackson based JSON objects, allowing an attacker to inject forged client roles into tokens. This flaw corresponds to CWE-20 and can enable an attacker to gain unauthorized access to protected resources by presenting a token that lists roles they do not possess.

Affected Systems

The vulnerability affects deployments of Keycloak, the open source identity and access management solution, whenever a protocol mapper is configured to output structured claims as JSON type. No specific vendor product version information is provided, so all systems using such mappers could be impacted until a patch is applied.

Risk and Exploitability

The CVSS score of 6.5 indicates a medium severity vulnerability. Because the EPSS score is not available, the likelihood of exploitation cannot be quantified directly, and the vulnerability is not listed in the CISA KEV catalog. The most likely attack vector is an attacker who has the ability to configure or modify a protocol mapper—such as through administrative access or an abuse of client registration—to inject the malicious JSON object that bypasses token sanitization. Once token sanitization is bypassed, the attacker can claim roles that are not authorized and potentially gain access to protected resources.

Generated by OpenCVE AI on November 6, 2026 at 02:06 UTC.

Remediation

Vendor Workaround

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.


OpenCVE Recommended Actions

  • Upgrade Keycloak to the latest version or to a version where this flaw is fixed by the vendor.
  • If an upgrade is not immediately possible, disable or remove any protocol mappers that emit structured claims using the JSON type, or reconfigure them to use a standard Java map.
  • Review and audit all token claims in the system to ensure that no unauthorized client roles are present and restrict token generation to trusted clients only.

Generated by OpenCVE AI on November 6, 2026 at 02:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 06 Nov 2026 06:15:00 +0000

Type Values Removed Values Added
Title keycloak-services: keycloak-services: Protocol mapper with jsonType=JSON bypasses token sanitization Keycloak-services: keycloak-services: protocol mapper with jsontype=json bypasses token sanitization
First Time appeared Redhat
Redhat build Keycloak
Redhat red Hat Single Sign On
CPEs cpe:/a:redhat:build_keycloak:
cpe:/a:redhat:red_hat_single_sign_on:7
Vendors & Products Redhat
Redhat build Keycloak
Redhat red Hat Single Sign On
References

Fri, 06 Nov 2026 00:15:00 +0000

Type Values Removed Values Added
Description 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.
Title keycloak-services: keycloak-services: Protocol mapper with jsonType=JSON bypasses token sanitization
Weaknesses CWE-20
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N'}

threat_severity

Moderate


Subscriptions

Redhat Build Keycloak Red Hat Single Sign On
cve-icon MITRE

Status: PUBLISHED

Assigner: redhat

Published:

Updated: 2026-11-06T06:03:03.806Z

Reserved: 2026-09-25T06:24:21.206Z

Link: CVE-2026-97848

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-11-06T06:16:45.540

Modified: 2026-11-06T06:16:45.653

Link: CVE-2026-97848

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-11-05T00:00:00Z

Links: CVE-2026-97848 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-11-06T02:15:18Z

Weaknesses
  • CWE-20

    Improper Input Validation