Repository navigation
Description
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
Client-protocol condition can be bypassed on admin client creation by…
Client-protocol condition can be bypassed on admin client creation by…
Client-protocol condition can be bypassed on admin client creation by…
Client-protocol condition can be bypassed on admin client creation by…
Client-protocol condition can be bypassed on admin client creation by…
Client-protocol condition can be bypassed on admin client creation by…