mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 04:32:32 +00:00
c59e65ee0a
SsrfGuard.ValidateDestinationAsync resolved the webhook host and checked it, then HttpClient resolved it again for the POST, so a DNS-rebinding host could pass the check and be connected to an internal address. The webhook client's SocketsHttpHandler now connects through SsrfGuard.ConnectToPublicAddress: it resolves once per connection, refuses the connection if any address is blocked, enforces HTTPS and connects the socket only to the checked addresses; TLS still runs against the request host. The pre-flight check is removed, the registration moves to AddWebhookNotificationHttpClient so a test can prove the wiring, the notification retry policy no longer retries a refused destination, and the test endpoint reports the refusal with the same message as before. IsBlockedAddress follows the same model as the MCP server: all IANA special-purpose space, IPv6 only 2000::/3, zone ids and IPv4-mapped addresses refused (IPNetwork.Contains judges a mapped address by its IPv4 form, so those are refused first). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>