Conversation
Secures the outbound OIDC discovery request flow against SSRF, JWKS substitution, and credential leakage. Blocks cross-host redirects: Configures a custom CheckRedirect callback on all OIDC discovery clients to reject redirects that attempt to leave the original issuer's host boundary. SSRF was previously mitigated by adding anchors to the meta issuer regex, but this was not a complete mitigation since a malicious meta issuer could specify an HTTP redirect, which the Go HTTP client would follow by default. Restricts bearer token injection: Updates bearerTokenTransport to only attach the Kubernetes service-account bearer token when the outgoing request destination host exactly matches the expected issuer's host. This prevents token leakage during both redirect scenarios and cross-host JWKS URIs. Signed-off-by: Hayden <8418760+Hayden-IO@users.noreply.github.com>
bobcallaway
approved these changes
May 26, 2026
Hayden-IO
pushed a commit
that referenced
this pull request
May 29, 2026
…ath (#2356) Gate the in-cluster CA + bearer-token attachment in httpClientForIssuer on the issuer being directly listed in OIDCIssuers, in addition to the existing match against k8sIssuerURL. Clusters whose --service-account-issuer is not literally https://kubernetes.default.svc (e.g. K3s, which uses https://kubernetes.default.svc.cluster.local) can again use the in-cluster auth path when their issuer URL is explicitly listed in OIDCIssuers. The SSRF/token-leak protection from #2354 is preserved: MetaIssuer wildcard matches against attacker-controlled hosts still do not receive the bearer token, because the new gate trusts only directly-listed OIDCIssuers entries (and the default k8sIssuerURL itself). Fixes #2355. Signed-off-by: Kevin Monroe <kevin.monroe@chainguard.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Secures the outbound OIDC discovery request flow against SSRF, JWKS substitution, and credential leakage.
Blocks cross-host redirects: Configures a custom CheckRedirect callback on all OIDC discovery clients to reject redirects that attempt to leave the original issuer's host boundary. SSRF was previously mitigated by adding anchors to the meta issuer regex, but this was not a complete mitigation since a malicious meta issuer could specify an HTTP redirect, which the Go HTTP client would follow by default.
Restricts bearer token injection: Updates bearerTokenTransport to only attach the Kubernetes service-account bearer token when the outgoing request destination host exactly matches the expected issuer's host. This prevents token leakage during both redirect scenarios and cross-host JWKS URIs.
Summary
Release Note
Documentation