aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/config.py
diff options
context:
space:
mode:
authorDennis Fink2026-10-30 20:31:43 +0100
committerDennis Fink2026-10-30 20:31:43 +0100
commit13a9d9ddce09230017699bc34ac3bf08ed2f84ed (patch)
tree3715bd13439a61a8cc6896581811a30b62ac1b16 /webmentions_ssg/config.py
parent8c561e702ed15022b17eae81e4185448c021e1cb (diff)
downloadwebmentions-ssg-13a9d9ddce09230017699bc34ac3bf08ed2f84ed.tar.gz
webmentions-ssg-13a9d9ddce09230017699bc34ac3bf08ed2f84ed.zip
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.
Diffstat (limited to 'webmentions_ssg/config.py')
-rw-r--r--webmentions_ssg/config.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/webmentions_ssg/config.py b/webmentions_ssg/config.py
index e8288db..1c7d44e 100644
--- a/webmentions_ssg/config.py
+++ b/webmentions_ssg/config.py
@@ -45,6 +45,8 @@ class DefaultConfig:
MAX_REDIRECTS = 20
MAX_SOURCE_BYTES = 1_000_000
REQUEST_TIMEOUT = 5.0
+ # Absolute wall-clock budget for each verification or delivery attempt.
+ REQUEST_TOTAL_TIMEOUT = 30.0
# Requeue abandoned verification attempts after 15 minutes.
VERIFICATION_TIMEOUT_SECONDS = 900
VERIFICATION_REAPER_SCHEDULE = "*/5 * * * *"