Validate session transfer redirect with saferedirect

The session transfer handler was blindly redirecting to the continue URL
from the signed token. Use saferedirect with a trust center domain check
to prevent open redirects, and only trigger session transfer for known
trust center custom domains instead of any non-base-URL host.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-31 14:34:20 +02:00
parent 84a35c90e9
commit 8095ac6233
3 changed files with 17 additions and 4 deletions

View File

@@ -176,7 +176,7 @@ func (h *OIDCHandler) buildSessionTransferURL(ctx context.Context, redirectURL s
token, err := authn.SignSessionTransfer(sessionID, redirectURL, h.cookieSecret)
if err != nil {
h.logger.Error("cannot sign session transfer token", log.Error(err))
h.logger.ErrorCtx(ctx, "cannot sign session transfer token", log.Error(err))
return "", false
}