From 13a9d9ddce09230017699bc34ac3bf08ed2f84ed Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 20:31:43 +0100 Subject: fix(core): prevent DNS rebinding in HTTP requests Pin outbound connections to validated public IP addresses so DNS changes cannot redirect receiver or sender requests onto private or link-local networks. Apply the same protection across redirects, add an overall request deadline, and keep DNS resolution out of synchronous endpoint form validation. --- contrib/webmentions-ssg.example.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/webmentions-ssg.example.cfg b/contrib/webmentions-ssg.example.cfg index bf363b8..02b0744 100644 --- a/contrib/webmentions-ssg.example.cfg +++ b/contrib/webmentions-ssg.example.cfg @@ -44,8 +44,14 @@ LOGFILE_BACKUP_COUNT = 10 # Webmention. Include each hostname you serve; wildcards are not supported. ALLOWED_HOSTNAMES = {"example.com", "www.example.com"} +# Defense in depth: restrict the Huey worker service account with outbound +# firewall/network-policy rules that block loopback, RFC1918, link-local, ULA, +# and cloud metadata ranges, including IPv6. The application also pins +# validated DNS IPs, but deployment-level filtering is still necessary. + # Limits for fetching/verifying incoming sources. -REQUEST_TIMEOUT = 5.0 # seconds; also used for outgoing requests +REQUEST_TIMEOUT = 5.0 # seconds per socket operation (both directions) +REQUEST_TOTAL_TIMEOUT = 30.0 # seconds overall, including DNS, redirects and body MAX_REDIRECTS = 20 # also used for outgoing requests MAX_SOURCE_BYTES = 1_000_000 # Requeue stuck verifications and lost queued tasks after 15 minutes. -- cgit v1.3.1