From 9b018f6f7be4df4b2f08efb909131c98765b0620 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 23 Feb 2026 13:44:31 +0100 Subject: [PATCH] Fix HTML injection in error message (Z#23225396) We're not treating it as a security issue as there is no vector to inject the HTML into other people's browser, only one's own. --- src/pretix/control/views/event.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pretix/control/views/event.py b/src/pretix/control/views/event.py index bb34ca6356..d09a833181 100644 --- a/src/pretix/control/views/event.py +++ b/src/pretix/control/views/event.py @@ -870,11 +870,15 @@ class MailSettingsPreview(EventPermissionRequiredMixin, View): ) except ValueError: - msgs[self.supported_locale[idx]] = '
{}
'.format( - PlaceholderValidator.error_message) + msgs[self.supported_locale[idx]] = format_html( + '
{}
', + PlaceholderValidator.error_message + ) except KeyError as e: - msgs[self.supported_locale[idx]] = '
{}
'.format( - _('Invalid placeholder: {%(value)s}') % {'value': e.args[0]}) + msgs[self.supported_locale[idx]] = format_html( + '
{}
', + _('Invalid placeholder: {%(value)s}') % {'value': e.args[0]} + ) return JsonResponse({ 'item': preview_item,