Repository navigation
Conversation
…sses Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch was successfully deployed
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.
Problem
The service fetches URLs that outsiders choose: provider endpoints come from on-chain multiaddrs, manifest locations from deal proposals. Today:
10.xor169.254.169.254passes, and redirects are followed unchecked.That lets someone point the service at its own network (SSRF). In production the Decodo proxy happens to carry plain-HTTP requests elsewhere, but HTTPS goes direct and an environment without the proxy has no protection.
Change
All in the shared client from
build_client, plus one filter in the multiaddr parser:/ip4and/ip6components with non-public addresses are dropped, so the endpoint is discarded.is_public_ipmoves fromdeal_manifest.rstohttp_client.rsand now also catches IPv4-mapped IPv6 (::ffff:10.0.0.5).As with the existing manifest check, debug builds allow everything, because local development and the tests use localhost mock servers.
Things to check before merging
Client::new()elsewhere (BMS, Lotus, cid.contact) are untouched; they call fixed, configured URLs.100.64.0.0/10(CGNAT) and other special ranges beyond what the existing check listed.Testing
cargo fmt --check,cargo clippy --workspace, and all 88 unit tests pass locally, including new tests for the address check and the resolver.🤖 Generated with Claude Code