Fix XSS vulnerabilities in snippet annotations and plugin template
Change-Id: I7cd476e4cddc785eff465d6f5595bdbbe8aa9f45
diff --git a/cmd/koralmapper/main.go b/cmd/koralmapper/main.go
index 75a1d9c..c1fbabe 100644
--- a/cmd/koralmapper/main.go
+++ b/cmd/koralmapper/main.go
@@ -14,7 +14,6 @@
"strconv"
"strings"
"syscall"
- texttemplate "text/template"
"time"
"github.com/KorAP/Koral-Mapper/config"
@@ -308,7 +307,7 @@
func setupRoutes(app *fiber.App, m *mapper.Mapper, yamlConfig *config.MappingConfig) {
configTmpl := template.Must(template.ParseFS(staticFS, "static/config.html"))
- pluginTmpl := texttemplate.Must(texttemplate.ParseFS(staticFS, "static/plugin.html"))
+ pluginTmpl := template.Must(template.ParseFS(staticFS, "static/plugin.html"))
// Health check endpoint
app.Get("/health", func(c *fiber.Ctx) error {
@@ -716,7 +715,7 @@
return nil
}
-func handleKalamarPlugin(yamlConfig *config.MappingConfig, configTmpl *template.Template, pluginTmpl *texttemplate.Template) fiber.Handler {
+func handleKalamarPlugin(yamlConfig *config.MappingConfig, configTmpl *template.Template, pluginTmpl *template.Template) fiber.Handler {
return func(c *fiber.Ctx) error {
mapID := c.Params("map")