Browse Source

:bug: remove ability to call env and expandenv in webhook (#1977)

This allows an attacker to exfiltrate environment variables.

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Moritz Johner 3 years ago
parent
commit
6da8b96d4d
1 changed files with 1 additions and 2 deletions
  1. 1 2
      pkg/provider/webhook/webhook.go

+ 1 - 2
pkg/provider/webhook/webhook.go

@@ -27,7 +27,6 @@ import (
 	tpl "text/template"
 	"time"
 
-	"github.com/Masterminds/sprig/v3"
 	"github.com/PaesslerAG/jsonpath"
 	"gopkg.in/yaml.v3"
 	corev1 "k8s.io/api/core/v1"
@@ -446,7 +445,7 @@ func executeTemplate(tmpl string, data map[string]map[string]string) (bytes.Buff
 	if tmpl == "" {
 		return result, nil
 	}
-	urlt, err := tpl.New("webhooktemplate").Funcs(sprig.TxtFuncMap()).Funcs(template.FuncMap()).Parse(tmpl)
+	urlt, err := tpl.New("webhooktemplate").Funcs(template.FuncMap()).Parse(tmpl)
 	if err != nil {
 		return result, err
 	}