diff --git a/src/pretix/control/urls.py b/src/pretix/control/urls.py index b47ccdf436..c3ba01fb12 100644 --- a/src/pretix/control/urls.py +++ b/src/pretix/control/urls.py @@ -93,5 +93,5 @@ urlpatterns = [ url(r'^orders/$', orders.OrderList.as_view(), name='event.orders'), url(r'^attendees/$', attendees.AttendeeList.as_view(), name='event.attendees'), ])), - url(r'^help/(?P[^.]+)$', help.HelpView.as_view(), name='help'), + url(r'^help/(?P[a-zA-Z0-9_/]+)$', help.HelpView.as_view(), name='help'), ] diff --git a/src/pretix/control/views/help.py b/src/pretix/control/views/help.py index da69f62034..9645a0fcd8 100644 --- a/src/pretix/control/views/help.py +++ b/src/pretix/control/views/help.py @@ -13,6 +13,10 @@ class HelpView(View): paginate_by = 30 def get(self, request, *args, **kwargs): + # In a security review, this came up as a possible path traversal issue. However, the URL regex + # does not allow any dots in the argument (which forbids traversing upwards in the directory tree). + # Even if it *was* possbile, it'd be loaded through django's template loader and therefore limited + # to TEMPLATE_DIR. try: locale = request.LANGUAGE_CODE return render(request, 'pretixcontrol/help/%s.%s.html' % (kwargs.get('topic'), locale), {})