From dc1112eaf8807b9ec6d9e7437073a1dc5ee3f107 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Fri, 8 May 2020 19:50:49 -0700 Subject: [PATCH] Disallow the blanket wildcard prefix from being used as custom host --- agent/structs/config_entry_gateways.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent/structs/config_entry_gateways.go b/agent/structs/config_entry_gateways.go index e0e67ad93..83c54148b 100644 --- a/agent/structs/config_entry_gateways.go +++ b/agent/structs/config_entry_gateways.go @@ -190,6 +190,10 @@ func validateHost(host string) error { return fmt.Errorf("Host %q is not valid, a wildcard specifier is only allowed as the leftmost label", host) } + if host == "*" { + return fmt.Errorf("Host '*' is not allowed, wildcards can only be used as a prefix/suffix") + } + return nil }