mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-07-05 11:02:49 +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.
|
// 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.
|
// IsValidName checks for invalid characters and path traversals.
|
||||||
func IsValidName(hyphaName string) bool {
|
func IsValidName(hyphaName string) bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user