fix(controlplane): validate the OIDC login callback URL (CP-N2) - #3322
Open
migmartri wants to merge 1 commit into
Open
fix(controlplane): validate the OIDC login callback URL (CP-N2)#3322migmartri wants to merge 1 commit into
migmartri wants to merge 1 commit into
Conversation
migmartri
marked this pull request as ready for review
August 3, 2026 00:48
The `callback` query param of /auth/login was stored and later redirected to verbatim, so a crafted login link ended the OIDC dance at an attacker origin carrying the user JWT in the query string. The callback is now restricted to relative paths, loopback (CLI login) and the origins the deployment already declares: the control plane external URL, the login URL and ui_dashboard_url. The token redirect also opts out of caching and referrer leakage. Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
migmartri
force-pushed
the
fix/cpn2-oidc-callback-open-redirect
branch
from
August 3, 2026 00:51
2de96e2 to
cf9940d
Compare
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.
The
callbackquery parameter of/auth/loginwas stored in a cookie and later redirected to verbatim, with no validation of scheme or host. A crafted login link ended the OIDC flow at an arbitrary origin with the user JWT in the query string.The callback is now restricted to:
localhost,127.0.0.0/8,::1), used by the CLI loginui_dashboard_urlValidation runs before the OIDC flow starts and is repeated on the callback leg so a tampered cookie cannot reopen the redirect. The token redirect also sets
Cache-Control: no-storeandReferrer-Policy: no-referrer.No new configuration is introduced: existing deployments keep working through
ui_dashboard_urlandserver.http.external_url, and rejections name the offending origin.🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri