From dfec3fca463269021243ab45f1441e91b2de7689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Wed, 25 Nov 2026 10:26:33 +0100 Subject: [PATCH] 1.16.8 Co-Authored-By: Claude Opus 5.5 --- docs/CHANGELOG.md | 60 +++++++++++++++++++++++++++-------------------- package.json | 2 +- src/version.ts | 2 +- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 89e3da1..281f607 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,23 +8,34 @@ versions at once, go through every "Requires project changes" section in order, version you have. A new release = a new section at the top; we remove the oldest ones only once there are more than 20. -## Unreleased — security follow-ups to 1.16.7 (version to be set at release) +## 1.16.8 — security follow-ups to 1.16.7 > **Read before upgrading.** No option, schema, migration or import-map change. Three points: -> **A site built with Turbopack** (`next build` without `--webpack`) published the plugin's `package.json`: -> update and rebuild (see Security). +> **A site built with Turbopack** (`next build` without `--webpack`) published the plugin's `package.json` (registry +> and repository addresses, no secret): update, rebuild, check that `find .next/static -name 'package*.json'` prints +> nothing, and purge a CDN or cache that may still hold the file. A webpack build (the starter's script): nothing. > **What can stop people:** on a project's own staff collection **without access rules of its own** whose > accounts can hold `editor` or `admin` although its roles are not just the plugin's — a `roles` select such as > `user, editor, admin, boss` or `viewer, editor`, or a `roles` field that is text, json or a relationship (all > with `hasMany`, i.e. holding a list; a single-valued field is not affected) — an account that is > not an admin can no longer create, delete or unlock accounts there, change another account, or change > anybody's roles. If **no** staff account holds `admin`, nobody can (the start log says so; the way out is -> below). +> below). And the other way round: in a staff collection whose `roles` is a **single** select with only +> `user` / `editor` / `admin`, accounts manage each other again (see Changed). > **Only where a plugin listed after ipalKit copies a staff collection, or makes a collection of your config the > panel's** (`admin.user`): some answers get narrower there — see "Requires project changes". No known site does > either. ### Security +- **A Turbopack build of a site published the plugin's `package.json`.** The plugin read its own version from + that file by a path relative to its module, and a bundler takes such a file for an asset: Turbopack copied it + to `/_next/static/media/package..json`, where anyone could fetch it. It is the **plugin's** manifest, not + the project's: the plugin's name and version, its dependency lists with version ranges (also the development + ones), its script names, and the addresses of the package registry and the git repository it comes from. **No + secret, token or password**, and nothing of the project. The file name is a content hash and no page links to + it. A webpack build (`next build --webpack`, what the starter and the reference site use) kept the file on the + server side: not served. The version is now a constant in the code (`src/version.ts`); nothing is read from + disk at run time. - **A staff collection whose accounts can hold `editor` or `admin` gets the admin rules.** The plugin's checks go by the value on the account: `admin` on an account of a staff collection makes a plugin admin, `editor` an editor — whatever else the collection's `roles` field offers. But a project's own staff collection without @@ -53,16 +64,18 @@ once there are more than 20. stood — an account of any auth collection (a customer) could create, change and delete panel accounts there. Now it gets the plugin's rules when the config goes live, for every operation that had **no** rule in your config; an operation you wrote a rule for keeps it exactly as written (`AccountsMarker.own`). -- **A Turbopack build of a site published the plugin's `package.json`.** The plugin read its own version from - that file by a path relative to its module, and a bundler takes such a file for an asset: Turbopack copied it - to `/_next/static/media/package..json`, where anyone could fetch it. It is the **plugin's** manifest, not - the project's: the plugin's name and version, its dependency lists with version ranges (also the development - ones), its script names, and the addresses of the package registry and the git repository it comes from. **No - secret, token or password**, and nothing of the project. The file name is a content hash and no page links to - it. A webpack build (`next build --webpack`, what the starter and the reference site use) kept the file on the - server side: not served. The version is now a constant in the code (`src/version.ts`); nothing is read from - disk at run time. +### Changed +- **A single-valued `roles` field no longer brings the admin rules.** The plugin counts roles only from an array, + so an account whose `roles` is one value (`'admin'` in a select without `hasMany`, a radio) was never a plugin + admin. Yet in 1.16.7 a project's own staff collection whose single select offered only `user` / `editor` / + `admin` got the admin rules — and then nobody in it could create, delete or unlock accounts, unless a plugin + admin existed in another staff collection. Such a collection now gets "an account of this collection", like any + collection whose roles are not the plugin's: its accounts manage each other again. Nothing of the plugin's opens: + the value still grants + nothing of the plugin's. But inside such a second staff collection this is wider than 1.16.7: an account with the + value `user` can create, change or delete the account with the value `admin`. **If your own code gives rights by + this value, write the collection's own rules** (`ipal-doctor --url` → `staff-own-roles` names it). ### Fixed - `next dev`: a collection that becomes a staff collection in an edit (named in `access.staffCollections` for @@ -82,7 +95,7 @@ once there are more than 20. - The start log tells a collection that became staff after ipalKit ran from one a later plugin added, and names the rules of its own that were kept. -### Requires project changes +### Requires project changes (what projects must update) - **A staff collection of your own, without access rules, whose accounts can hold `editor` or `admin`** (a `roles` select with `hasMany` and one of them next to values of your own, or a `roles` field that is text or a relationship with `hasMany`, or json): only an admin @@ -97,8 +110,11 @@ once there are more than 20. or write the collection's own rules. To switch the default off for every staff collection: `accounts: { adminOnlyCreate: false, adminOnlyWrite: false }` (that also takes the protection off). - **A site built with Turbopack:** update and rebuild — the new build has no `package..json` under - `/_next/static/media/`. Check: `find .next/static -name 'package*.json'` prints nothing. Nothing to do for a - webpack build. + `/_next/static/media/`. Check: `find .next/static -name 'package*.json'` prints nothing. Purge a CDN or cache in + front of the site. Nothing to do for a webpack build. +- **A staff collection of your own whose `roles` is one value** (a select without `hasMany`) with only `user` / + `editor` / `admin`, and no access rules: its accounts manage each other again (see Changed). If your own code + gives rights by that value, write the collection's rules. - **Only if a plugin of yours copies a staff collection** (`{ ...staff, slug: 'copy' }`, or a new collection that reuses a staff collection's `access` object) — three answers get narrower: - **The copy's own accounts and "the account itself".** In the copy, the copied rule "an admin, or the account @@ -120,15 +136,6 @@ once there are more than 20. (or list that plugin before ipalKit) — then it is handled at config time like any staff collection. - `pnpm ipal:skills`. -### Changed -- **A single-valued `roles` field no longer brings the admin rules.** The plugin counts roles only from an array, - so an account whose `roles` is one value (`'admin'` in a select without `hasMany`, a radio) was never a plugin - admin. Yet in 1.16.7 a project's own staff collection whose single select offered only `user` / `editor` / - `admin` got the admin rules — and then nobody in it could create, delete or unlock accounts, unless a plugin - admin existed in another staff collection. Such a collection now gets "an account of this collection", like any - collection whose roles are not the plugin's: its accounts manage each other again. Nothing of the plugin's opens: - the value still grants nothing. - ### Known limitations - A staff collection **without a `roles` field** is unchanged: every account of it is an admin to the plugin. - A `roles` select of your own whose values hold neither `editor` nor `admin` is unchanged: inside it every @@ -145,6 +152,9 @@ once there are more than 20. a reload the adoption still runs with the options the site started with. - A marker or a function mark written by hand in the project's own config is taken at its word ("handled" for a marker of the collection's own slug); a hand-made function mark only ever adds the plugin's rule in front. +- **Not run for this release:** a built site on Postgres or SQLite (the account rules ran over HTTP on SQLite, Postgres + and MongoDB; the built site, webpack and Turbopack, on MongoDB); a real plugin that copies a staff collection; a + real tracing library around access rules. ## 1.16.7 — hardening diff --git a/package.json b/package.json index b742111..62d2fad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intecion/ipal-kit", - "version": "1.16.7", + "version": "1.16.8", "description": "Intecion Payload Advanced Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.", "license": "MIT", "repository": { diff --git a/src/version.ts b/src/version.ts index b12905d..6a6483b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -7,4 +7,4 @@ * `/_next/static/media/`. Written by `node scripts/write-version.mjs` (the `version` script of * package.json runs it on `pnpm version …`); test/version.test.ts fails when the two differ. */ -export const PLUGIN_VERSION = '1.16.7' +export const PLUGIN_VERSION = '1.16.8'