fix: reject invalid authentication origin authorities

This commit is contained in:
Codex
2026-10-06 16:12:32 +02:00
parent 2aac228cdc
commit 24b03d4caf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1177,7 +1177,7 @@ func rolesToStrings(roles []Role) []string {
// ValidPublicURL follows the backend policy: HTTP requires canonical literal loopback.
func ValidPublicURL(value string) bool {
parsed, err := url.Parse(value)
if err != nil || parsed.Host == "" || parsed.User != nil || (parsed.Path != "" && parsed.Path != "/") || parsed.RawQuery != "" || parsed.Fragment != "" {
if err != nil || parsed.Hostname() == "" || strings.Contains(parsed.Hostname(), "%") || parsed.User != nil || (parsed.Path != "" && parsed.Path != "/") || parsed.RawQuery != "" || parsed.Fragment != "" {
return false
}
if port := parsed.Port(); port != "" {