From 9a1e863079b64883beadaba7b283621f1b3cf70a Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 29 Oct 2026 19:49:44 +0100 Subject: fix(receiver): rate limit Webmention submissions Protect the public endpoint from abusive request floods and repeated duplicate submissions that would otherwise trigger unnecessary verification work. Add per-client and global limits, require shared limiter storage in production, and only reverify existing Webmentions after a configurable cooldown. --- webmentions_ssg/config.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'webmentions_ssg/config.py') diff --git a/webmentions_ssg/config.py b/webmentions_ssg/config.py index 6cadbab..aea201b 100644 --- a/webmentions_ssg/config.py +++ b/webmentions_ssg/config.py @@ -34,6 +34,13 @@ class DefaultConfig: MAIL_PASSWORD = None MAIL_DEFAULT_SENDER = None + RATELIMIT_STORAGE_URI = "memory://" + RATELIMIT_HEADERS_ENABLED = True + + ENDPOINT_RATE_LIMIT = "10/minute;100/hour" + ENDPOINT_GLOBAL_RATE_LIMIT = "1000/hour" + ENDPOINT_REVERIFY_COOLDOWN_SECONDS = 600 + class DevelopmentConfig(DefaultConfig): DEBUG = True -- cgit v1.3.1