Repository navigation
Check the IPv4 address that NAT64 and 6to4 addresses carry - #133
Merged
Merged
Conversation
The dial-time gate checked IPv6 addresses only as IPv6, so on a network with NAT64, 64:ff9b::a9fe:a9fe passed and reached 169.254.169.254. Addresses under the NAT64 well-known prefix, 6to4 and IPv4-compatible addresses are now also checked as the IPv4 address they carry, and the local-use NAT64 prefix 64:ff9b:1::/48 counts as private.
andrew
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dial-time gate checked IPv6 addresses only as IPv6.
net.IPtreats IPv4-mapped::ffff:a.b.c.das IPv4, but not the other forms that carry an IPv4 address, so on a network with NAT6464:ff9b::a9fe:a9fepassed the gate and reached 169.254.169.254. A redirect or a URL in upstream metadata pointing at such an address could get past the block list.Now:
64:ff9b::/96, 6to42002::/16and IPv4-compatible::a.b.c.dare also checked as the IPv4 address they carry, so a public one such as64:ff9b::808:808still passes;64:ff9b:1::/48(RFC 8215) counts as private, since where the IPv4 address sits in it depends on the network.AllowPrivateandAllowPrivateHostsapply to the embedded address as they do to the address itself.Summary by CodeRabbit