From 839f6bdc15391ab03e52a516a828b7ea157d724a Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 29 Oct 2026 18:03:15 +0100 Subject: fix(sender): validate Webmention status URLs Treat status URLs returned by remote endpoints as untrusted input so malformed or non-HTTP schemes cannot be persisted or exposed as clickable links. Preserve successful delivery when a Location header is invalid while rendering legacy unsafe status values as plain text in the admin interface. --- webmentions_ssg/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webmentions_ssg/__init__.py') diff --git a/webmentions_ssg/__init__.py b/webmentions_ssg/__init__.py index 04746d6..61add02 100644 --- a/webmentions_ssg/__init__.py +++ b/webmentions_ssg/__init__.py @@ -21,6 +21,7 @@ from sqlalchemy.orm import DeclarativeBase from webmentions_ssg.config import DefaultConfig, DevelopmentConfig, ProductionConfig from .tasks import Huey +from .url_security import is_http_url APP_NAME = "webmentions-ssg" VERSION = "0.0.2" @@ -126,6 +127,8 @@ def create_app(config_class: type[DefaultConfig] | None = None) -> Flask: """ return {"VERSION": VERSION} + app.add_template_filter(is_http_url) + from .views import root_page app.register_blueprint(root_page) -- cgit v1.3.1