1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

shared/validate: Don't allow $ in API names

Since some of those names may be passed to a shell either on the client
or server side, let's avoid getting into potential variable expansions.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Reported-by:  Rory McNamara <rory.mcnamara@snyk.io>
This commit is contained in:
Stéphane Graber
2026-01-17 08:35:27 -05:00
parent bf512b985d
commit 26f45a11ae

View File

@@ -574,7 +574,7 @@ func IsAPIName(value string, allowSlashes bool) error {
}
// Check for special URL characters.
reservedChars := []string{"?", "&", "+", "\"", "'", "`", "*"}
reservedChars := []string{"$", "?", "&", "+", "\"", "'", "`", "*"}
if !allowSlashes {
reservedChars = append(reservedChars, "/")
}