Changelog - 2026-11-06
The url guard refuses NAT64, 6to4, multicast and documentation IPv6 addresses, and any url with credentials
Security Behavior ChangeIn one line. UrlPolicy.assertSafeUrl let a literal IPv6 url reach an internal address, for example the cloud metadata IP through NAT64 (https://[64:ff9b::a9fe:a9fe]/), and accepted https://user:pass@host/. Both are refused now.
What changed
- IPv6 ranges.
isNonPublicAddressexpands an address to its eight groups before it classifies it, so every spelling of an address gets one answer (0:0:0:0:0:0:0:1is loopback, as::1is). An address that carries an IPv4 one is judged by the IPv4 rules: NAT64 (64:ff9b::/96), 6to4 (2002::/16), IPv4-compatible (::a.b.c.d) and the v4-mapped forms. Multicast (ff00::/8), site-local (fec0::/10), documentation (2001:db8::/32,3fff::/20), the IETF protocol assignments2001::/23(Teredo among them), discard (100::/64), SRv6 (5f00::/16), the rest of64:ff9b::/32and the reserved::/8are non-public. A string that is not an IPv6 literal fails closed, and so does a string longer than any IPv6 text. - Userinfo.
assertSafeUrlrefuses a url with a username or a password withURL_REFUSED. There is no policy flag to allow it: a credential in a url is a way to smuggle a different host past a reviewer or a log line, and a webhook url never needs one. - Canonical IPv4 text.
isNonPublicAddressreads dotted decimal without leading zeros.0177.0.0.1(octal to some parsers),1e2.0.0.1and1.2.3.0000answertrueinstead of being read as a number. A url never reaches this:new URLcanonicalises it first. - Documented.
isNonPublicAddresstakes an IP literal only; a domain name answerstrue. An empty userinfo (https://@host/) carries no credentials and passes.
Who is affected
- Code that fetches a url from an untrusted source through
UrlPolicy,UrlIngestorfetchGuarded. Urls that pointed at those IPv6 ranges, or that carried credentials, are refused now. - Code that sent credentials in the url on purpose. Send them in a header instead.
- Everyone else. No action needed.
Breaking changes
WARNING
A url with a username or a password, and an IPv6 literal in the ranges above, were accepted before and are refused now.
Details
| File | Package |
|---|---|
src/modules/network/utilities/url-safety/policy.ts | helpers |