convox / convox

Audit the usage of unescaped data in HTML templates GSC-G203
Security
Major
11 days agoa year old
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.
 89			return strings.ReplaceAll(s, "\"", "\\\"")
 90		},
 91		"safe": func(s string) template.HTML {
 92			return template.HTML(fmt.Sprintf("%q", s)) 93		},
 94		"shellsplit": func(s string) ([]string, error) {
 95			return shellquote.Split(s)
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.
13			return common.CoalesceString(ss...)
14		},
15		"safe": func(s string) template.HTML {
16			return template.HTML(fmt.Sprintf("%q", s))17		},
18		"upper": func(s string) string {
19			return common.UpperName(s)
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.
607func templateHelpers() map[string]interface{} {
608	return map[string]interface{}{
609		"safe": func(s string) template.HTML {
610			return template.HTML(fmt.Sprintf("%q", s))611		},
612	}
613}
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.
140		return c.RenderTemplate("404", params)
141	}
142
143	params["Body"] = template.HTML(d.Body)144	params["Breadcrumbs"] = documents.Breadcrumbs(d.Slug)
145	params["Category"] = d.Category()
146	params["Path"] = d.Path
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.
 88			return i*16 + 10
 89		},
 90		"join": func(sep string, ss []string) template.HTML {
 91			return template.HTML(strings.Join(ss, sep)) 92		},
 93		"mul": func(x, y int) int {
 94			return x * y