fix(06-13): full IANA special-use SSRF tables and reject zoned dial targets

This commit is contained in:
Jakub Zych
2026-09-21 19:44:51 +02:00
parent 4bad1a43a2
commit b1079ab8a4
4 changed files with 47 additions and 18 deletions

View File

@@ -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)
}
}
}