Skip to content

Reconsider public-client redemption of ID-JAG assertions in the embedded AS #6984

Closed

Description

@jhrozek

Bug description

Since #6677, the ID-JAG handler lets a public client redeem an ID-JAG by sending only its client_id. This was a deliberate choice, and the PR described it as a trade-off. It is worth revisiting.

  • fosite returns a public client as soon as the form client_id resolves to one (client_authentication.go: if client.IsPublic() { return client, nil }). No secret or key is needed.
  • checkClientBinding (pkg/authserver/server/tokenexchange/id_jag_handler.go) then compares the assertion's client_id claim with that resolved client's ID. For a public client, whoever presents the assertion supplies the form client_id, so they can copy it from the assertion. The binding checks nothing in that case.
  • The handler ignores the client's grant_types, so every public client (open-DCR clients with none, CIMD clients) can reach it. Configured delegate clients, confidential DCR clients and SPIFFE clients are confidential.

draft-ietf-oauth-identity-assertion-authz-grant-04:

  • §9.1: "This specification SHOULD only be supported for confidential clients. Public clients SHOULD use the existing authorization code grant and redirect the user to the Resource Authorization Server..."
  • §5: requiring a confidential client "helps to prevent the IdP Authorization Server from delegating access to any of the valid clients for the Resource Authorization Server."
  • §4.4.1: the client_id claim "MUST identify the same client as the client authentication in the request."

The #6677 description says: "Draft §9.1 RECOMMENDS confidential redeeming clients; this accepts identified public clients too ... If you'd rather gate public clients behind config, that's an easy follow-up knob on the issuer policy." This issue is that follow-up.

Steps to reproduce

  1. Enable a JWT-bearer issuer policy with a subject binding.
  2. Register a public client (DCR, auth method none).
  3. Redeem an IdP-minted ID-JAG for that client using grant_type, assertion, client_id and resource, with no secret.

An access token is issued. The only limits are the single-use jti, max_assertion_age, audience matching and the subject binding's allowed resources. No refresh token is issued.

Expected behavior

Public clients are refused unless an operator opts in for that issuer.

Actual behavior

Any holder of a valid, unused ID-JAG for a public client can redeem it. For example, if the assertion leaks from a proxy log or browser history before the legitimate client redeems it, the leaker gets an access token for that user, and the legitimate redemption then fails because the jti is spent. With a confidential client the same leak is useless without the secret or key.

Additional context

  • In this repo, vMCP's XAA strategy sends HTTP Basic only when it has both a client ID and a secret (pkg/oauthproto/grants.go), so it does not depend on public redemption.
  • pkg/authserver/integration_test.go (around line 7253) redeems with a public client, so it will need updating.
  • Settings for the issuer policy live in JWTBearerGrantPolicy (pkg/authserver/server/tokenexchange/multi_issuer_validator.go), JWTBearerIssuerPolicyRunConfig (pkg/authserver/inbound_grants.go) and the CRD's JWTBearerGrantConfig.

Proposed fix

Add a per-issuer opt-in, default off: allow_public_id_jag_clients in RunConfig and allowPublicIDJAGClients in the CRD. In IDJAGHandler, reject client.IsPublic() with unauthorized_client after the client binding check and before the assertion is consumed, unless the flag is set. Update the handler comment and docs/arch/17-token-exchange-delegation.md, regenerate the CRDs, swagger and SDK, and add a release note.

Behavior change: a public client that redeems ID-JAGs today stops working until the operator sets the flag or moves the client to a confidential registration. Before choosing this, confirm that the deployments that motivated #6677 can do one of the two.

Alternatives: refuse public clients outright (breaks those deployments, no escape hatch), or keep the current behavior and document the risk.

Acceptance criteria

  • A public client redeeming an ID-JAG gets unauthorized_client by default, and the jti stays unconsumed.
  • With the flag on, public redemption works as it does today.
  • Confidential, private_key_jwt and SPIFFE clients work regardless of the flag.
  • The flag is accepted in RunConfig and the CRD, converted correctly, and covered by tests (RunConfig normalization, operator conversion, CRD round-trip).
  • The docs explain the trade-off and cite §9.1.

Activity

  1. added
    needs-triage
    on Oct 28, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. removed
    needs-triage
    on Nov 22, 2026
  4. added a commit that references this issue on Nov 23, 2026
    4b6b17d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authenticationenhancementoauth

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions