mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-11-04 07:53:59 +00:00
fix(security): treat trailing-dot hosts as their blocked names
validateHost and isLoopbackHost matched hostnames by exact string. The spellings localhost. and metadata.google.internal. passed the SSRF check. The check now drops the root dot and any IPv6 zone id first. A bare IPv6 literal without a port no longer fails the host check.
This commit is contained in:
@@ -954,6 +954,7 @@ func isValidSecureURL(s string) bool {
|
||||
// isLoopbackHost reports whether host is "localhost" or a loopback IP literal
|
||||
// (127.0.0.0/8 or ::1).
|
||||
func isLoopbackHost(host string) bool {
|
||||
host = canonicalHost(host)
|
||||
if strings.EqualFold(host, "localhost") {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user