flannel-io / flannel

flannel is a network fabric for containers, designed for Kubernetes
Apache License 2.0
8.74k stars 2.87k forks source link

IsPrivate Bypass #1958

Open aydinnyunus opened 5 months ago

aydinnyunus commented 5 months ago

Hi Team,

I found possible SSRF and Open Redirect Vulnerability on the https://github.com/flannel-io/flannel/blob/master/pkg/backend/wireguard/wireguard_network.go#L127

You can find the POC on the following Playground link. The IsPrivate function did not check all of the internal URLs. So you can use IsLinkLocalUnicast, IsLinkLocalMulticast, IsLoopback functions to do that.