Repository navigation
Require connections permission on the upload page - #726
Open
chrisclark wants to merge 1 commit into
Open
chrisclark wants to merge 1 commit into
chrisclark wants to merge 1 commit into
Conversation
DatabaseConnectionUploadCreateView was the one view in this module without PermissionRequiredMixin, so anyone who could reach the URL -- including an anonymous visitor -- got the upload form back with a 200. The template renders valid_connections, the list of uploaded SQLite connections, so it also disclosed the alias and id of every user's uploaded database. Those ids are the values UploadDbView accepts as "append". The POST that actually uploads is guarded, so this was disclosure rather than an upload path; still, it was the upload flow's entry point and every sibling view requires connections_permission. Added ExplorerContextMixin alongside the permission mixin, matching the other connection views, so the page is rendered with the same context (can_manage_connections and friends) rather than silently missing it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the unauthenticated upload page. High.
DatabaseConnectionUploadCreateViewis the only view inexplorer/ee/db_connections/views.pywithoutPermissionRequiredMixin, so anyone who could reach the URL got the upload form back with a 200. Confirmed before the fix:Meanwhile
/explorer/connections/correctly showed the login page to the same non-staff and anonymous requests, which is what made this stand out.The impact is disclosure, not upload: the template renders
valid_connections, so it leaked the alias and id of every user's uploaded SQLite database, and those ids are exactly the valuesUploadDbViewaccepts asappend. ThePOSTthat performs the upload is separately guarded, so this was the flow's unguarded entry point rather than a way to write files.Fix
Requires
EXPLORER_PERMISSION_CONNECTIONS, matching every sibling view in the module. Also addedExplorerContextMixinalongside it — the other connection views use it, and without it this page was rendered without the shared context (can_manage_connectionsand friends).Tests
In
SimpleViewTests:Full suite: 294 tests, OK.
ruff check explorer/: clean.