fix(06-13): full IANA special-use SSRF tables and reject zoned dial targets
This commit is contained in:
@@ -77,3 +77,16 @@ func TestIsReservedOrPrivateIPv6Transitions(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsReservedOrPrivateSpecialUseSmoke(t *testing.T) {
|
||||
for _, s := range []string{"198.18.0.1", "192.0.0.1", "240.0.0.1", "255.255.255.255", "2001:db8::1", "fec0::1", "fe80::1%eth0"} {
|
||||
if !isReservedOrPrivate(netip.MustParseAddr(s)) {
|
||||
t.Errorf("%s should be non-public", s)
|
||||
}
|
||||
}
|
||||
for _, s := range []string{"8.8.8.8", "1.1.1.1", "2606:4700:4700::1111"} {
|
||||
if isReservedOrPrivate(netip.MustParseAddr(s)) {
|
||||
t.Errorf("%s should be public", s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user