Repository navigation
fix(alert): harden webhook SSRF filter (#333) - #349
Merged
Merged
Conversation
Resolve DNS once, reject if any record is non-public, pin the connection to the vetted addresses (closes rebinding/TOCTOU). Cover IPv4-mapped IPv6, ULA, site-local, NAT64, 0/8, 192.0.0/24, 198.18/15, multicast, broadcast, reserved. Use url::Host so bracketed/decimal/hex/octal literals are judged correctly, block localhost aliases and userinfo. Validate webhook URL at rule creation (400). Log host only, not the full URL (may contain tokens). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Closes #333
What
resolve_to_addrs). Redirects stay disabled.ip_is_privatecovers IPv4-mapped IPv6, ULA, fec0::/10, 64:ff9b::/96, multicast, 0.0.0.0/8, 192.0.0.0/24, 198.18.0.0/15, broadcast, 240/4.url::Hostso bracketed IPv6 and decimal/hex/octal literals are judged correctly; blocks localhost aliases and userinfo URLs.Why
The SSRF filter was bypassable via DNS rebinding/TOCTOU, mixed public/private records, IPv4-mapped/ULA addresses and missing creation-time validation (issue #333). Full URLs (often containing tokens) were also logged.
Testing
New unit tests for ranges, literal encodings, URL validation and mixed-record rejection.
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspaceall pass.Deferred: no rule-update endpoint exists; per-request client drops connection pooling.
🤖 Generated with Claude Code