Verify the discovery document's issuer in the IdP resolver #59
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Security architecture review, 18 Sep 2026 (candidate 5, "Worth exploring"). The IdP resolver fetches
<issuer>/.well-known/openid-configurationand takestoken_endpoint,authorization_endpoint, andjwks_urifrom the document — but never verifies that the document'sissuerfield equals the requested issuer URL, as RFC 8414 §3 and OIDC Discovery require. The bridge's trust anchor is TLS to the issuer host, so exploiting this needs issuer-host compromise; but the consequence of a bad document is asymmetric: a Confidential client's client secret is POSTed to the document'stoken_endpoint, and JWKS is fetched from the document'sjwks_uri. A misconfigured or hostile document on a shared/multi-tenant IdP host can redirect the bridge's secret-bearing traffic. The id_tokenisscheck against the CRD's issuer URL (which the serving path does correctly) stops session forgery, but not endpoint redirection.What to build
Add
issuerto the discovery struct and requiredoc.Issuer == issuerURL(with the RFC's trailing-slash normalization) in the document validation. A mismatch is a resolve failure — the existing keep-last-good behaviour still applies, so a transient bad document never blanks the last-good signing keys or endpoints.Acceptance criteria
issuer; validation requires it to equal the requested issuer URL (trailing-slash normalized)Blocked by