i2goSignals

goSignals

12. Authorization scope checks read shape-aware predicates, not AuthContext.Eat

Date: 2026-06-02

Status

Accepted

Context

External OIDC bearer-token validation (validateOAuthToken in internal/authUtil/auth_token.go) returns Eat: nil for every OAuth/STS caller — the granted scopes live elsewhere on the AuthContext. Several authorization gates read scope directly off AuthContext.Eat, so they silently misbehaved for every OAuth caller regardless of the scope the AS actually granted. This bug class bit three times:

In the worst case the Eat-only shape did not merely deny — the create-only key guard (keyScopeOnly) returned false for OAuth callers (Eat == nil), which exempted an OAuth key-only caller from the guard and granted full key takeover: a latent privilege escalation.

Separately (#144), external bearer validation accepted any signing algorithm, never checked audience, and honoured a foreign realm role literally named root as a cluster-wide grant.

Decision

Never scope-check via AuthContext.Eat directly. Two shape-aware predicates in internal/authUtil/auth_token.go are the only sanctioned way to scope-check a caller:

Supporting decisions:

The three direct-Eat sites migrated onto the predicates are the tx_alias gate (canProvisionTxAlias), the StreamUpdate payload re-check, and the create-only key guard (keyScopeOnly).

Consequences

Positive

Negative