1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-04 18:19:54 +00:00

Fix hyphaNamePattern regexp

There wasn't actually a vulnerability AFAIC because hypha names are
passed through CanonicalName which strips those characters, but fix it
anyway for the sake of correctness.
This commit is contained in:
Umar Getagazov 2022-08-21 16:18:28 +03:00
parent 55879806a3
commit 945cdc934c

View File

@ -8,7 +8,7 @@ import (
)
// hyphaNamePattern is a pattern which all hyphae names must match.
var hyphaNamePattern = regexp.MustCompile(`[^?!:#@><*|"'&%{}]+`)
var hyphaNamePattern = regexp.MustCompile(`^[^?!:#@><*|"'&%{}]+$`)
// IsValidName checks for invalid characters and path traversals.
func IsValidName(hyphaName string) bool {