Server settings → People → Plugins: the account lookup runs before the staff check, so the status code says whether an account exists #373
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#373
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the Server settings views and checking each person view's order of lookup and permission check with the test client.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/server_views.py:1189-1191(PersonPluginsView.dispatch);core/mixins.py:74has not moved, and the test client gives the same answers.PersonPluginsViewlooks the account up indispatchbefore it callssuper().dispatch, andsuper().dispatchis whereStaffRequiredMixin(LoginRequiredMixinplusUserPassesTestMixin) runs its checks. The lookup therefore answers visitors who are not signed in and people who are not administrators: a missing account gets 404, an existing one the sign-in redirect or 403. Every other person view looks the account up ingetorpost, after the checks, and answers the same whichever account number is asked for.core/server_views.py:1188-1190,PersonPluginsView.dispatch; the checks it runs ahead of areStaffRequiredMixinincore/mixins.py:74./server/people/<pk>/plugins/for an account that exists answers 302 to sign-in when nobody is signed in, and 403 to a signed-in person who is not an administrator. For an account number that does not exist it answers 404 to both.server:person_username, by comparison, answers 302 to an anonymous visitor either way. Checked with the test client against the snapshot: anonymous 302 for an existing account and 404 for a missing one; non-administrator 403 and 404.dispatchoverride and fetch the person inget_context_dataandpost(through a small_person()helper), asPersonDeleteViewandPersonRecoveryViewdo.Done when
tests/test_server_settings.pyasks forserver:person_pluginswith an existing and a missing account number, anonymously and as a non-administrator, and gets the same status code for both in each case (302, then 403); it fails today with 404 for the missing number.