Skip to content

may_act bypasses AllowedActors and is only gated by a wildcard-permitted AllowedDelegateClients #6323

Closed

Description

@jhrozek

Problem

checkDelegationConsent (pkg/authserver/server/tokenexchange/handler.go),
consent path 1: when a subject token carries a well-formed may_act claim,
it is authoritative — resolveAllowedActor/AllowedActors is skipped
entirely (by design, per #5989's original consent-model decision: "If the
subject token carries may_act ... it is authoritative"). The only remaining
check is AllowedDelegateClients, which validateTrustedIssuer explicitly
permits to be the wildcard "*" ("any ToolHive client holding the
token-exchange grant").

So: any external IdP that can be induced to emit a may_act claim — a
claim-mapping misconfiguration, or an IdP that maps a user-editable profile
field into a claim — can name any ToolHive client as delegate
, for any
issuer where AllowedDelegateClients is wildcarded. Requiring
may_act.iss == selfIssuer-style checks doesn't help; may_act's fields are
attacker/issuer-controlled by definition on the external path. This is
exactly the confused-deputy pattern (CWE-863) AllowedActors was built to
close, reopened through the one consent path deliberately designed to bypass
it.

This was an accepted, deliberate design tradeoff in #5989 (a per-RFC-8693-§4.4
authoritative signal), not a bug — but the risk profile changes as
AllowedDelegateClients: ["*"] becomes a more common, even recommended,
configuration (see the ActorMatcher/client-assertion-auth extension issue,
which pairs naturally with a wildcarded AllowedDelegateClients). What was a
narrow, deliberately-accepted edge case becomes a live default-configuration
concern.

Proposed fix

Add a per-issuer AllowMayAct bool (default false) to TrustedIssuer.
When false (the default), the external validator / checkDelegationConsent
reject a may_act-bearing subject token from that issuer outright, rather
than silently trusting it (external tokens have no client_id-binding
fallback, so there is nothing softer to fall back to). Operators who
genuinely need may_act support from a specific issuer opt in explicitly.

Cost: per the arch doc's own language, "no major IdP emits may_act today,"
so a default of false should not break any known real-world configuration.

Also reject the combination AllowMayAct: true + AllowedDelegateClients
containing "*" at config-validation time — same posture as the existing
rule rejecting "*" combined with specific IDs in AllowedDelegateClients
(permissiveness must be a deliberate, singular declaration, not obtainable
by omission or by combining options).

Relationship to other issues

  • Distinct from Harden act/may_act handling on the external-issuer token exchange path #6113 (may_act shape validation gap on the external
    path, act hop missing iss, unbounded act subtree size) — that issue
    is about malformed/oversized claims reaching the handler; this one is
    about the consent model itself trusting a well-formed may_act too
    broadly by default. Both are real and independent; given Harden act/may_act handling on the external-issuer token exchange path #6113's own "why
    one issue" note about touching the same two files, this one should
    probably land as its own PR since it touches TrustedIssuer validation and
    checkDelegationConsent's branch order, not claim shape/size.
  • Interacts with the ActorMatcher/AllowClientAssertionAuth issue: that
    issue's AllowedDelegateClients: ["*"] recommendation is the reason this
    one's severity is going up, not the cause of the underlying gap. Land this
    one first or alongside it.

Activity

  1. added
    go
    on Aug 13, 2026
  2. added
    needs-triage
    on Aug 13, 2026
  3. self-assigned this
    on Aug 14, 2026
  4. added 3 commits that reference this issue on Aug 17, 2026
    38aa57c
    1655de1
    50e640f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authenticationgoneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions