Conversation
CCIP Read blocked RFC1918 and loopback on the resolved address, but ::ffff:127.0.0.1 is an IPv6 address so it skipped those networks. Unwrap ipv4_mapped before the blocklist so OffchainLookup URLs cannot reach loopback, link-local, or private IPv4 via mapped form.
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.
Summary
validate_ccip_url_host) rejects resolved addresses in RFC1918, loopback, link-local, and IPv6 ULA ranges so an OffchainLookup URL cannot send the client at private infrastructure.::ffff:127.0.0.1(and::ffff:10.0.0.1,::ffff:169.254.169.254) is an IPv6 address, so it is not a member of the IPv4 block list and the request proceeded.IPv6Address.ipv4_mappedbefore the blocklist. Public mapped addresses such as::ffff:8.8.8.8still pass.Attacker: a contract that returns OffchainLookup URLs. They already choose the URL. The guard is supposed to fail closed on private/reserved IPs after DNS. Mapped IPv6 skipped that guard.
Test plan
test_blocked_ipv4_mapped_ipv6for loopback, RFC1918, and link-local mapped formstest_public_ipv4_mapped_ipv6_passesfor::ffff:8.8.8.8_check_ip_blocked("::ffff:127.0.0.1")is falsenewsfragments/3875.bugfix.rst268493aCommit is SSH-signed.