Skip to content

Bind strict SSRF validation to direct dials - #1

Merged
jcalabro merged 3 commits into
mainfrom
jc/identity-dns-convoy
Aug 24, 2026
Merged

Bind strict SSRF validation to direct dials#1
jcalabro merged 3 commits into
mainfrom
jc/identity-dns-convoy

Conversation

@jcalabro

Copy link
Copy Markdown
Member

Summary

  • bind strict SSRF validation to direct connection establishment
  • resolve each hostname once, reject the full answer set if any address is blocked, and dial only validated literal IPs
  • preserve request-time preflight behavior for proxies, custom transports, and private-redirect opt-outs
  • retain multi-address fallback while safely handling losing connections and caller-supplied dialers

Verification

  • just
  • just test-race
  • adversarial cross-model review

jcalabro and others added 3 commits August 24, 2026 18:49
In strict direct mode (WithStrictSSRFProtection + WithNoProxy without
WithAllowPrivateRedirects), the IP-policy dial wrapper resolves the
request hostname itself with the configured resolver and hands the
underlying dialer an already-validated literal IP. This makes the prior
WithDialContext/WithResolver contract false for that mode: WithResolver
is no longer ignored (it drives the validation lookup) and a custom
dialer never receives the original hostname.

The behavior is intentional -- it closes the DNS-rebinding window between
validation and dial -- so correct the public doc comments to describe the
exception rather than change the code.

Found via adversarial cross-model review (roast R-8ec3d3).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jcalabro
jcalabro merged commit 8975b98 into main Aug 24, 2026
1 check passed
@jcalabro
jcalabro deleted the jc/identity-dns-convoy branch August 24, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant