ResolutionNetworkGuard

SSRF deny-list for outbound DID-resolution requests whose host comes from an untrusted DID (for example did:web).

It extends PrivateNetworkGuard (loopback, any-local, link-local, site-local, multicast, IPv6 unique-local) with ranges that guard misses:

  • 0.0.0.0/8 ("this network"; 0.0.0.0 reaches localhost on Linux)

  • 100.64.0.0/10 (RFC 6598 carrier-grade NAT, used for internal cloud networks)

  • 192.0.0.0/24 (IETF protocol assignments), 198.18.0.0/15 (benchmarking)

  • 240.0.0.0/4 (reserved) and the 255.255.255.255 broadcast address

  • TEST-NET documentation ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and IPv6 documentation 2001:db8::/32, Teredo 2001::/32, and the local-use NAT64 64:ff9b:1::/48

  • fc00::/7 and fe80::/10 checked explicitly from the raw bytes

  • IPv6 addresses that embed an IPv4 address (IPv4-mapped ::ffff:0:0/96, IPv4-compatible ::/96, NAT64 64:ff9b::/96, 6to4 2002::/16): the embedded IPv4 address is checked against the same list.

Functions

Link copied to clipboard

True if address must never be the target of a resolution request.

Link copied to clipboard

Resolves host and returns why it is disallowed, or null when every resolved address is a permitted public address. An unresolvable host is reported as a rejection.