Repository navigation
test(webfetch): cover per-lookup address policy for DNS rebinding - #110
Merged
Merged
Conversation
Split the address check out of resolve_checked_host so the guarded resolver's policy can be tested without live DNS. Tests cover public-only, private-only, metadata, mixed public/private, and empty answers. The resolver runs this check on every connection, so a name that changes answer is refused on the lookup that returns the private address. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Closes the test gap around DNS rebinding in WebFetch. The guarded resolver already checks every address on every connection. This change moves the address policy into
check_resolved_addrs, which can be called without DNS, and tests the cases the defence depends on: public-only answers pass; private, metadata, and empty answers are refused; a mixed public/private answer is refused.Not covered
Real DNS rebinding against live networks is still not exercised here. The test checks the per-lookup policy, not the resolver's timing.
Verification
cargo test -p code-toolspasses, includingresolved_addresses_are_all_checked_on_every_lookup.cargo clippy -p code-tools --all-targets -- -D warningspasses.🤖 Generated with Claude Code