From f0c4a51a1df79c75e1eaafe0fa0612df116fb1d0 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 29 Oct 2025 20:29:51 +0100 Subject: [PATCH] Fix mail addr validation Signed-off-by: Bryan Frimin --- pkg/server/auth/saml_check_sso_handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/server/auth/saml_check_sso_handler.go b/pkg/server/auth/saml_check_sso_handler.go index c8e940b6e..0a08bd4b5 100644 --- a/pkg/server/auth/saml_check_sso_handler.go +++ b/pkg/server/auth/saml_check_sso_handler.go @@ -18,6 +18,7 @@ import ( "encoding/json" "fmt" "net/http" + "net/mail" authsvc "github.com/getprobo/probo/pkg/auth" "go.gearno.de/kit/httpserver" @@ -52,6 +53,11 @@ func SAMLCheckSSOHandler(authSvc *authsvc.Service, logger *log.Logger) http.Hand return } + if _, err := mail.ParseAddress(req.Email); err != nil { + httpserver.RenderError(w, http.StatusBadRequest, fmt.Errorf("invalid email format")) + return + } + configs, err := authSvc.CheckSSOAvailabilityByEmail(ctx, req.Email) if err != nil { logger.ErrorCtx(ctx, "cannot check SSO availability", log.Error(err))