feat(ssrf): add missing transport wrappings and more checks BE-13021 (#2967)

This commit is contained in:
andres-portainer
2026-06-19 16:43:15 -03:00
committed by GitHub
parent eee086e378
commit 5a2e53e853
18 changed files with 154 additions and 10 deletions
@@ -12,6 +12,7 @@ import (
httperror "github.com/portainer/portainer/pkg/libhttp/error"
"github.com/portainer/portainer/pkg/libhttp/request"
"github.com/portainer/portainer/pkg/libhttp/response"
"github.com/portainer/portainer/pkg/validate"
)
var (
@@ -35,6 +36,10 @@ type GitAuthenticationUpdatePayload struct {
// Validate implements the portainer.Validatable interface
func (payload *GitSourceUpdatePayload) Validate(_ *http.Request) error {
if payload.URL != nil && !validate.IsURL(*payload.URL) {
return errors.New("invalid repository URL. Must correspond to a valid URL format")
}
return nil
}