From b03daab452b5a51faf10f24b94de501217748463 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 25 Jan 2022 12:58:06 +0100 Subject: [PATCH] [SECURITY] Fix (non-exploitable) XSS issue --- .../pretixcontrol/checkin/checkins.html | 6 +++--- .../pretixcontrol/fragment_quota_box.html | 2 +- .../pretixcontrol/fragment_quota_box_paid.html | 2 +- .../templates/pretixcontrol/order/index.html | 12 ++++++------ .../stripe/checkout_payment_form_cc.html | 2 +- src/pretix/static/pretixcontrol/js/ui/main.js | 16 +++++++++++++++- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/checkin/checkins.html b/src/pretix/control/templates/pretixcontrol/checkin/checkins.html index 3b87cf2d9c..40589b141f 100644 --- a/src/pretix/control/templates/pretixcontrol/checkin/checkins.html +++ b/src/pretix/control/templates/pretixcontrol/checkin/checkins.html @@ -74,17 +74,17 @@ {{ c.datetime|date:"SHORT_DATETIME_FORMAT" }} {% if c.type == "exit" %} {% if c.auto_checked_in %} - {% endif %} {% elif c.forced and c.successful %} - {% elif c.forced and not c.successful %}
{% trans "Failed in offline mode" %} {% elif c.auto_checked_in %} - {% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/fragment_quota_box.html b/src/pretix/control/templates/pretixcontrol/fragment_quota_box.html index 0d7ddf490d..82b1a16f1f 100644 --- a/src/pretix/control/templates/pretixcontrol/fragment_quota_box.html +++ b/src/pretix/control/templates/pretixcontrol/fragment_quota_box.html @@ -1,6 +1,6 @@ {% load i18n %}
{% blocktrans with date=q.cached_availability_time|date:"SHORT_DATETIME_FORMAT" %}Numbers as of {{ date }}{% endblocktrans %}"> + title="{% trans "Quota:" %} {{ q.name|force_escape|force_escape }}
{% blocktrans with date=q.cached_availability_time|date:"SHORT_DATETIME_FORMAT" %}Numbers as of {{ date }}{% endblocktrans %}"> {% if q.size|default_if_none:"NONE" == "NONE" %}
diff --git a/src/pretix/control/templates/pretixcontrol/fragment_quota_box_paid.html b/src/pretix/control/templates/pretixcontrol/fragment_quota_box_paid.html index 19b80e9e42..1878965a56 100644 --- a/src/pretix/control/templates/pretixcontrol/fragment_quota_box_paid.html +++ b/src/pretix/control/templates/pretixcontrol/fragment_quota_box_paid.html @@ -1,6 +1,6 @@ {% load i18n %} {% blocktrans with num=q.cached_avail.1 %}Currently available: {{ num }}{% endblocktrans %}{% endif %}" + title="{% trans "Quota:" %} {{ q.name|force_escape|force_escape }}{% if q.cached_avail.1 is not None %}
{% blocktrans with num=q.cached_avail.1 %}Currently available: {{ num }}{% endblocktrans %}{% endif %}" href="{% url "control:event.items.quotas.show" event=q.event.slug organizer=q.event.organizer.slug quota=q.pk %}"> {% if q.size|default_if_none:"NONE" == "NONE" %}
diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index 10de1ad2b5..eb0daa0ddc 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -360,19 +360,19 @@ {% if line.checkins.all %} {% for c in line.all_checkins.all %} {% if not c.successful %} - + {% elif c.type == "exit" %} {% if c.auto_checked_in %} - + {% else %} - + {% endif %} {% elif c.forced %} - + {% elif c.auto_checked_in %} - + {% else %} - + {% endif %} {% endfor %} {% endif %} diff --git a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html index c9b2799aa0..a0a5cc8365 100644 --- a/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html +++ b/src/pretix/plugins/stripe/templates/pretixplugins/stripe/checkout_payment_form_cc.html @@ -3,7 +3,7 @@
{% if is_moto %}

- MOTO + MOTO

{% endif %} diff --git a/src/pretix/static/pretixcontrol/js/ui/main.js b/src/pretix/static/pretixcontrol/js/ui/main.js index fed379cfd3..11c49a3974 100644 --- a/src/pretix/static/pretixcontrol/js/ui/main.js +++ b/src/pretix/static/pretixcontrol/js/ui/main.js @@ -675,7 +675,21 @@ $(function () { $('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip_html"]').tooltip({ - 'html': true + 'html': true, + 'whiteList': { + // Global attributes allowed on any supplied element below. + '*': ['class', 'dir', 'id', 'lang', 'role'], + b: [], + br: [], + code: [], + div: [], // required for template + h3: ['class', 'role'], // required for template + i: [], + small: [], + span: [], + strong: [], + u: [], + } }); var url = document.location.toString();