Skip to content

Client-protocol condition can be bypassed on admin client creation by omitting protocol #51202

Description

@ahus1

Area

oidc

Describe the bug

Client-protocol condition can be bypassed on admin client creation by omitting protocol.

This issue was imported from the Wilson expanded appsec run as WILSON-KC-CLIENT-POLICY-006. The affected behavior is reproducible according to the focused Wilson proof metadata below.

Version

Observed against Keycloak source commit 878eb21cf6733ff09a98d07ec4381de7de071553 on main during the Wilson validation run.

Expected behavior

Evaluate REGISTER client-protocol conditions against the effective protocol that will be stored, applying the same OIDC default used by RepresentationToModel when the representation omits protocol. Alternatively, normalize/default the representation before triggering admin create policies. Add regression coverage for omitted protocol on admin REST create with OIDC-scoped profiles.

Actual behavior

Admin REST client policies scoped to OIDC clients can be bypassed during client creation by omitting protocol, even though the resulting client is an OIDC client. The demonstrated profile lets a delegated client manager create a secret-based OIDC client where policy required private-key JWT. The actor still needs client management privileges and the issue affects protocol-scoped policy selection rather than unauthenticated access, so severity is Medium.

How to Reproduce?

A realm administrator configures a client policy for client-protocol=openid-connect, for example attaching secure-client-authenticator so OIDC clients created through admin REST must use private-key JWT. A delegated client manager creates a confidential client through the admin REST API but omits the protocol field. ClientsResource evaluates the policy against the raw representation, ClientProtocolCondition sees protocol=null and votes NO, and the secure profile does not run. ClientManager.createClient then applies the normal model defaults and persists the client as openid-connect with the default client-secret authenticator.


This issue was originally tracked in the private repository. Migrated by @ahus1.

Activity

  1. added
    area/oidc
    priority/important
    on Jul 27, 2026
  2. added theissue type on Jul 27, 2026
  3. self-assigned this
    on Aug 14, 2026
  4. added a commit that references this issue on Aug 14, 2026
    3c2e5cd
  5. added a commit that references this issue on Aug 17, 2026
    d6f3ca3
  6. added 3 commits that reference this issue on Aug 21, 2026
    372c02e
    3eb2a85
    f7df458
  7. added a commit that references this issue on Aug 21, 2026
    c519ecf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Fields

No fields configured for weakness.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions