Skip to content

Commit

Permalink
🩹 Fix: validate IP addresses in App.handleTrustedProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
xEricL committed Oct 16, 2024
1 parent 9c12e40 commit a7d8479
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,12 @@ func (app *App) handleTrustedProxy(ipAddress string) {
app.config.TrustProxyConfig.ranges = append(app.config.TrustProxyConfig.ranges, ipNet)
}
} else {
app.config.TrustProxyConfig.ips[ipAddress] = struct{}{}
ip := net.ParseIP(ipAddress)
if ip == nil {
log.Warnf("IP address %q could not be parsed", ipAddress)
} else {
app.config.TrustProxyConfig.ips[ipAddress] = struct{}{}
}
}
}

Expand Down

0 comments on commit a7d8479

Please sign in to comment.