mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Prevent anonymous users from accessing any setup page
Anonymous users were able to access pages that used the 'public' decorator of stronghold. If such a page showed the installation routine of the setup module they were able to access and use it, in other words: Anonymous users were able to install software.
This commit is contained in:
1 parent
8450b1e4c9
commit
da91981ff5
1 file changed
+3
-1
@@ -21,6 +21,7 @@ Django middleware to show pre-setup message and setup progress.
|
||||
|
||||
from django import urls
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
import logging
|
||||
|
||||
@@ -75,5 +76,6 @@ class SetupMiddleware(object):
|
||||
if module.setup_helper.get_state() == 'up-to-date':
|
||||
return
|
||||
|
||||
view = views.SetupView.as_view()
|
||||
# Only allow logged-in users to access any setup page
|
||||
view = login_required(views.SetupView.as_view())
|
||||
return view(request, setup_helper=module.setup_helper)
|
||||
Reference in new issue
Block a user