feat: webhook callback url security#2524
Open
lfleischmann wants to merge 10 commits intomainfrom
Open
Conversation
FreddyDevelop
approved these changes
Mar 30, 2026
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.
Descripton
Implement webhook SSRF protections.
Implementation
Multi-Layer Validation
Security Modes
Different
modes are configurable:public_onlyinternal_onlypublic_only, only allows callbacks to internal/non-public IP addressescustominsecure(recommended for development only)Allow/Block Lists
Host-level control:
allowed_hosts/blocked_hosts: Exact hostname matchingallowed_domains/blocked_domains: Domain and subdomain matchingallowed_cidrs/blocked_cidrs: IP range matchingRedirect control:
follow_redirects: Enable/disable redirect following (default: false)max_redirects: Limit redirect chainsIP Protection/Blocking for public mode
Metadata Endpoint Blocking
deny_metadata_endpoints)IPv6 Metadata Ranges:
fe80::/10- IPv6 link-local (used by cloud providers)fc00::/7- IPv6 Unique Local Addressesfd00:ec2::254/128- Common metadata range used by AWS EC2 metadata (IPv6)Hostname-based Metadata Protection:
metadata.google.internal(GCP)metadata.goog(GCP alternative)169.254.169.254.nip.io,*.xip.io,*.sslip.io(DNS rebinding bypass attempts)metadata,instance-data(generic metadata hostnames)169-254-169-254.ec2.internal(AWS internal format)Reserved IP Detection
::/128,100::/64,2001:db8::/32)DNS Rebinding Mitigation
IP Pinning with Custom Dialer
ValidationResulthttp.TransportwithValidatedDialerOther implementation notes
Avoid Circular Dependencies:
validation.SecurityPolicytype (mirrorsconfig.WebhookSecurity)WebhookSecurity.ToSecurityPolicy()converterConfigurable error sanitization
sanitize_errors