---
id: "CVE-2026-97848"
page: "https://infrastack.ai/live/CVE-2026-97848"
kind: "vulnerability"
aliases: ["CVE-2026-97848"]
title: "Keycloak: token sanitizer misses JSON claims, letting forged client roles through"
severity: "medium"
cvss: 6.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["identity", "keycloak", "package", "self-hosted"]
not_affected_if: ["no-json-protocol-mapper"]
published_at: "2026-11-06T06:16:45+00:00"
first_seen_at: "2026-11-06T06:40:13+00:00"
updated_at: "2026-11-06T06:41:31+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-97848", "first_seen_at": "2026-11-06T06:40:13+00:00"}]
exploit_sources: []
---

# Keycloak: token sanitizer misses JSON claims, letting forged client roles through

Link for people: https://infrastack.ai/live/CVE-2026-97848 (this .md is for agents)

When a Keycloak protocol mapper emits structured JSON claims, the check that strips unauthorized role mappings does not recognize Jackson JSON objects. An attacker can inject forged client roles into security tokens and reach protected resources.

_Summary, check and fix written by a model from the sources; labelled as such._

## Timeline

- 2026-11-06T06:40:13+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-97848

## From the 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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
