Security audit fixes: the document-locks door closed for customers, route reasons for the staff-only locks

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 17:03:56 +01:00
co-authored by Claude Opus 5.5
parent e5964d4e05
commit d90825a396
2 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ export const DOORS: Door[] = [
{ body: {}, closedFor: OUTSIDERS, method: 'POST', name: 'the header (navigation) cannot be saved', path: '/api/globals/header', closed: forbidden },
{ body: {}, closedFor: OUTSIDERS, method: 'POST', name: 'the company data cannot be saved', path: '/api/globals/company', closed: forbidden },
{
closedFor: ['anonymous'],
closedFor: OUTSIDERS,
name: 'who edits what (Payload\'s document locks, with the editor\'s account)',
// Payload's own collection: staff only since 1.18.0 (iapl `lockedDocuments`, the owner's Q3 answer (a)); Payload's
// default let any signed-in account in
+19 -19
View File
@@ -17,8 +17,8 @@
"DELETE /api/pages/:id": "deleteByID: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"DELETE /api/payload-kv": "delete: nobody (every rule false)",
"DELETE /api/payload-kv/:id": "deleteByID: nobody (every rule false)",
"DELETE /api/payload-locked-documents": "delete: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"DELETE /api/payload-locked-documents/:id": "deleteByID: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"DELETE /api/payload-locked-documents": "delete: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"DELETE /api/payload-locked-documents/:id": "deleteByID: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"DELETE /api/payload-preferences": "delete: own preferences only (Payload)",
"DELETE /api/payload-preferences/:id": "deleteByID: own preferences only (Payload)",
"DELETE /api/payload-preferences/:key": "deleteByID: own preferences only (Payload)",
@@ -102,11 +102,11 @@
"GET /api/payload-kv/count": "count: nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)",
"GET /api/payload-kv/versions": "versions: readVersions = read (nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)); no version history kept here",
"GET /api/payload-kv/versions/:id": "versionByID: readVersions = read (nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)); no version history kept here",
"GET /api/payload-locked-documents": "find: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"GET /api/payload-locked-documents/:id": "findByID: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"GET /api/payload-locked-documents/count": "count: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"GET /api/payload-locked-documents/versions": "versions: readVersions = read (Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)); no version history kept here",
"GET /api/payload-locked-documents/versions/:id": "versionByID: readVersions = read (Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)); no version history kept here",
"GET /api/payload-locked-documents": "find: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"GET /api/payload-locked-documents/:id": "findByID: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"GET /api/payload-locked-documents/count": "count: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"GET /api/payload-locked-documents/versions": "versions: readVersions = read (staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)); no version history kept here",
"GET /api/payload-locked-documents/versions/:id": "versionByID: readVersions = read (staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)); no version history kept here",
"GET /api/payload-preferences": "find: the signed-in account's own preferences only (Payload)",
"GET /api/payload-preferences/:id": "findByID: the signed-in account's own preferences only (Payload)",
"GET /api/payload-preferences/:key": "findByID: the signed-in account's own preferences only (Payload)",
@@ -141,8 +141,8 @@
"PATCH /api/pages/:id": "updateByID: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"PATCH /api/payload-kv": "update: nobody (every rule false)",
"PATCH /api/payload-kv/:id": "updateByID: nobody (every rule false)",
"PATCH /api/payload-locked-documents": "update: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"PATCH /api/payload-locked-documents/:id": "updateByID: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"PATCH /api/payload-locked-documents": "update: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"PATCH /api/payload-locked-documents/:id": "updateByID: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"PATCH /api/payload-preferences": "update: own preferences only (Payload)",
"PATCH /api/payload-preferences/:id": "updateByID: own preferences only (Payload)",
"PATCH /api/posts": "update: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
@@ -220,10 +220,10 @@
"POST /api/payload-kv/:id/duplicate": "duplicate: nobody (every rule false)",
"POST /api/payload-kv/access/:id?": "the signed-in account's own permissions on payload-kv",
"POST /api/payload-kv/versions/:id": "restore a version: nobody (every rule false)",
"POST /api/payload-locked-documents": "create: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"POST /api/payload-locked-documents/:id/duplicate": "duplicate: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"POST /api/payload-locked-documents": "create: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"POST /api/payload-locked-documents/:id/duplicate": "duplicate: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"POST /api/payload-locked-documents/access/:id?": "the signed-in account's own permissions on payload-locked-documents",
"POST /api/payload-locked-documents/versions/:id": "restore a version: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"POST /api/payload-locked-documents/versions/:id": "restore a version: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"POST /api/payload-preferences": "create: own preferences only (Payload)",
"POST /api/payload-preferences/:id/duplicate": "duplicate: own preferences only (Payload)",
"POST /api/payload-preferences/:key": "updateByID: own preferences only (Payload)",
@@ -259,7 +259,7 @@
"graphql mutation createMedia": "GraphQL create: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation createPage": "GraphQL create: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation createPayloadKv": "GraphQL create: nobody (every rule false)",
"graphql mutation createPayloadLockedDocument": "GraphQL create: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql mutation createPayloadLockedDocument": "GraphQL create: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql mutation createPayloadPreference": "GraphQL create: own preferences only (Payload)",
"graphql mutation createPost": "GraphQL create: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation createUser": "GraphQL create: create/delete/unlock: an admin with the second factor; update: admin or self; roles field: admin",
@@ -271,7 +271,7 @@
"graphql mutation deleteMedia": "GraphQL delete: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation deletePage": "GraphQL delete: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation deletePayloadKv": "GraphQL delete: nobody (every rule false)",
"graphql mutation deletePayloadLockedDocument": "GraphQL delete: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql mutation deletePayloadLockedDocument": "GraphQL delete: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql mutation deletePayloadPreference": "GraphQL delete: own preferences only (Payload)",
"graphql mutation deletePost": "GraphQL delete: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation deleteUser": "GraphQL delete: create/delete/unlock: an admin with the second factor; update: admin or self; roles field: admin",
@@ -283,7 +283,7 @@
"graphql mutation duplicateMedia": "GraphQL duplicate: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation duplicatePage": "GraphQL duplicate: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation duplicatePayloadKv": "GraphQL duplicate: nobody (every rule false)",
"graphql mutation duplicatePayloadLockedDocument": "GraphQL duplicate: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql mutation duplicatePayloadLockedDocument": "GraphQL duplicate: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql mutation duplicatePayloadPreference": "GraphQL duplicate: own preferences only (Payload)",
"graphql mutation duplicatePost": "GraphQL duplicate: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation forgotPasswordUser": "public by design: the same answer for a real and an invented address",
@@ -306,7 +306,7 @@
"graphql mutation updateNotification": "GraphQL update: editor+",
"graphql mutation updatePage": "GraphQL update: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation updatePayloadKv": "GraphQL update: nobody (every rule false)",
"graphql mutation updatePayloadLockedDocument": "GraphQL update: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql mutation updatePayloadLockedDocument": "GraphQL update: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql mutation updatePayloadPreference": "GraphQL update: own preferences only (Payload)",
"graphql mutation updatePost": "GraphQL update: editor+ (adminOrEditor, the site's own rule since 1.17.2; Payload's default would let any signed-in account in)",
"graphql mutation updateSiteIntegration": "GraphQL update: admin; secrets write-only",
@@ -335,8 +335,8 @@
"graphql query Pages": "GraphQL find: anyone (published content, no drafts)",
"graphql query PayloadKv": "GraphQL find: nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)",
"graphql query PayloadKvs": "GraphQL find: nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)",
"graphql query PayloadLockedDocument": "GraphQL find: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql query PayloadLockedDocuments": "GraphQL find: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql query PayloadLockedDocument": "GraphQL find: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql query PayloadLockedDocuments": "GraphQL find: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql query PayloadPreference": "GraphQL find: the signed-in account's own preferences only (Payload)",
"graphql query PayloadPreferences": "GraphQL find: the signed-in account's own preferences only (Payload)",
"graphql query Post": "GraphQL find: anyone (published content, no drafts)",
@@ -353,7 +353,7 @@
"graphql query countForms": "GraphQL count: anyone (the form renders from it; the Emails tab is staff-only by field access)",
"graphql query countPages": "GraphQL count: anyone (published content, no drafts)",
"graphql query countPayloadKvs": "GraphQL count: nobody (Payload: every rule false; the plugin keeps 2FA counts and the mail-service token here)",
"graphql query countPayloadLockedDocuments": "GraphQL count: Payload default: any signed-in account (the plugin-wide default is owner's Q3 (a), 2.0; the doctor's visitor-writes lists it)",
"graphql query countPayloadLockedDocuments": "GraphQL count: staff accounts with the second factor (iapl lockedDocuments, 1.18.0; set at start, Payload's default was any signed-in account)",
"graphql query countPayloadPreferences": "GraphQL count: the signed-in account's own preferences only (Payload)",
"graphql query countPosts": "GraphQL count: anyone (published content, no drafts)",
"graphql query countUsers": "GraphQL count: an admin, or the account itself (adminOrSelfIn users)",