Skip to content

fix(controlplane): validate the OIDC login callback URL (CP-N2) - #3322

Open
migmartri wants to merge 1 commit into
mainfrom
fix/cpn2-oidc-callback-open-redirect
Open

fix(controlplane): validate the OIDC login callback URL (CP-N2)#3322
migmartri wants to merge 1 commit into
mainfrom
fix/cpn2-oidc-callback-open-redirect

Conversation

@migmartri

@migmartri migmartri commented Aug 3, 2026

Copy link
Copy Markdown
Member

The callback query parameter of /auth/login was 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:

  • relative paths, used by the CAS download redirect
  • loopback on any port (localhost, 127.0.0.0/8, ::1), used by the CLI login
  • the origins the deployment already declares: the control plane external URL, the login URL and ui_dashboard_url

Validation 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-store and Referrer-Policy: no-referrer.

No new configuration is introduced: existing deployments keep working through ui_dashboard_url and server.http.external_url, and rejections name the offending origin.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri

Review in cubic

@migmartri
migmartri requested a review from a team August 3, 2026 00:37

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@migmartri
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
migmartri force-pushed the fix/cpn2-oidc-callback-open-redirect branch from 2de96e2 to cf9940d Compare August 3, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant