mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-05 02:29: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:
parent
55879806a3
commit
945cdc934c
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user