Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 12:11:56 +01:00
co-authored by Claude Opus 5.5
parent 0dffd377a7
commit 0709141cae
3 changed files with 55 additions and 18 deletions
+53 -16
View File
@@ -9,13 +9,50 @@ 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 version you have. A new release = a new section at the top; we remove the oldest ones only
once there are more than 20. once there are more than 20.
## 1.17.2 — DRAFT (security group C, round 2: the owner's Q1–Q3; not released) ## 1.17.2 — version history with readPublished, sign-in and panel actions, staff-only REST submissions and jobs, the cookie button
> Draft lines from session C (branch `claude/security-c-1172`); the integration session merges them with A's and B's. > **Read before upgrading.** No schema change, no migration on any database, no import-map change. What changes for
> No schema, migration or import-map change. **Read the first two lines if the site has a customer login collection > an existing site, most important first:
> or uses Payload jobs over HTTP**; otherwise nothing changes for it. >
> 1. **Fix: `readPublished()` on version history.** The form 1.17.1 documented, `readVersions: readPublished()`,
> answered every version read by a visitor or a plain account with **500** (MongoDB, Postgres and SQLite alike).
> It now works by itself: iapl() gives that `readVersions` the new `readPublishedVersions()` with the same role.
> Visitors see published versions only; a draft version by id is `403`; staff see everything, as before. A
> `readVersions` of your own that **wraps** `readPublished()` is not changed: use `readPublishedVersions()` inside it.
> 2. **A locked staff account is told "The email or password provided is incorrect."** (REST, GraphQL, the panel),
> so five wrong passwords no longer tell a stranger that an address has a staff account. A locked editor with the
> right password sees "incorrect" too until the lock ends (10 minutes); an admin can unlock it. Payload's message
> back: `accounts: { lockedAnswer: 'payload' }`. Known: the answer's **time** still differs for an existing
> account (Payload hashes only then); that is for 1.18.0.
> 3. **The plugin's panel actions refuse other origins** (mail service Connect / Disconnect, Send test e-mail, cookie
> scan, approval, site check): `403` for a request a browser marks as coming from elsewhere. The panel's buttons
> work. **Behind a proxy that rewrites `Host` and sends no `X-Forwarded-Host`, set `serverURL`**, or those buttons
> are refused too (the log says so once; `iapl-doctor` warns). Off: `adminSameOrigin: false`.
> 4. **A customer account can no longer create form submissions over REST / GraphQL** (staff only). The site's own
> forms (`submitForm`, `createSubmitAction`, the file endpoint) are not affected. Way back:
> `forms.formSubmissionOverrides.access.create`.
> 5. **Payload's job queue over HTTP: only an admin or `Authorization: Bearer <CRON_SECRET>`** (16+ characters), when
> the project wrote no `jobs.access.run`. **A cron that calls `/api/payload-jobs/run` must set `CRON_SECRET` and
> send the header**, or it gets `401`. In-process runs and a project's own rule are not affected;
> `jobsRunAccess: false` keeps Payload's default.
> 6. **The cookie button stays in the bottom corner and never moves**; while it is shown the footer gets a little
> room under its last row (about 43 px on the reference site) so the button covers nothing. No layout shift.
> No room: `<CookieButton reserve={false} />`; the placement before: `<CookieButton avoid={COOKIE_BUTTON_AVOID} />`.
> 7. **The consent version only goes up** through the panel, REST and GraphQL (a lower number would make old consent
> count again). The Local API with `overrideAccess` may still lower it; `cookieSettings: { allowLowerPolicyVersion: true }`
> restores the old freedom.
> 8. **IPv6 visitors are counted per /64** by every plugin rate limit (one home network shares a budget, as an
> IPv4 home behind one router always did). Per address: `setIpv6Grouping({ prefix: 128 })`.
### Security ### Security
- **Version history with `readPublished()`** (point 1): new `readPublishedVersions(minimum)` for `readVersions`;
`withVersionReadRules(entities)` swaps a marked `readPublished()` on `readVersions` (iapl() runs it on the
collections and globals it sees; a plugin listed after iapl() uses `readPublishedVersions()` itself).
- **Locked staff accounts answer like a wrong password** (point 2): `lockedLooksWrong`, `withLockedAnswer`,
`graphqlLoginName`; type `LockedAnswerOption`.
- **Panel actions from the site's own origin only** (point 3): `requireOwnOrigin`, `guardAdminEndpoints`,
`ADMIN_POST_ENDPOINTS`; type `AdminSameOriginOption`; `reportRefusedOrigin(req, origins?, context?)` takes a third
argument; `iapl-doctor` warns (`csrf-empty`) without `serverURL` or `csrf`.
- **A customer account can no longer create submissions over REST.** `POST /api/form-submissions` (and GraphQL - **A customer account can no longer create submissions over REST.** `POST /api/form-submissions` (and GraphQL
`createFormSubmission`) needed only a signed-in account of any login collection, so a customer of a visitor `createFormSubmission`) needed only a signed-in account of any login collection, so a customer of a visitor
collection could skip the rate limit, Turnstile, the consent tick and the validation, and the form's e-mails went collection could skip the rate limit, Turnstile, the consent tick and the validation, and the form's e-mails went
@@ -28,19 +65,19 @@ once there are more than 20.
environment and send the header; the start log says so when it is missing. In-process runs (`jobs.autoRun`, environment and send the header; the start log says so when it is missing. In-process runs (`jobs.autoRun`,
`payload jobs:run`) and a project's own rule are not affected; `iapl({ jobsRunAccess: false })` keeps Payload's `payload jobs:run`) and a project's own rule are not affected; `iapl({ jobsRunAccess: false })` keeps Payload's
default (security.md "Payload's job queue"). default (security.md "Payload's job queue").
- **The consent version only goes up** (point 7): `policyVersionNeverDown`, `buildCookieSettingsFields`,
`buildCookieSettings(options)`; type `CookieSettingsFieldOptions`.
- **IPv6 per network** (point 8): `setIpv6Grouping`, `ipRateKey`; type `Ipv6Grouping`. A second counter per /48 is
available (`wide: 48`), off by default.
### Added ### Added
- `iapl-doctor` deep rule **`visitor-writes`** (warning): on a site with a visitor login collection, every collection - `iapl-doctor` deep rule **`visitor-writes`** (warning): on a site with a visitor login collection, every collection
and global whose write rule lets such an account in, Payload's default included. and global whose write rule lets such an account in, Payload's default included.
- `jobsRunAccess`, `withJobsRunAccess`, `jobsRunNotice`, `cronSecretMatches`, `CRON_SECRET_ENV`, - `jobsRunAccess`, `withJobsRunAccess`, `jobsRunNotice`, `cronSecretMatches`, `CRON_SECRET_ENV`,
`CRON_SECRET_MIN_LENGTH`; option `jobsRunAccess`; env `CRON_SECRET`. `CRON_SECRET_MIN_LENGTH`; option `jobsRunAccess`; env `CRON_SECRET`.
- `CookieButton` prop `reserve` (the block that gets the room; `false` = off); `COOKIE_BUTTON_RESERVE`,
### Changed `COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace` (`/client`, type `CookieButtonSpaceOptions`);
- The reference site (and every new site from `iapl create`): `Pages`, `Posts`, `CaseStudies`, `Media` and the `consentDecidedScript` (root); the token `--ipal-cookie-button-space`.
`Header`, `Footer`, `Company` globals have their own write rules (`adminOrEditor`) instead of Payload's default.
Existing sites: nothing changes; the doctor's `visitor-writes` names what to add where it matters.
- Not built (owner's Q3 answer (a), planned for 2.0): a plugin-wide default for the project's own entities and for
Payload's `payload-locked-documents`.
### Changed ### Changed
- **What an existing site's visitors see: the "cookie settings" button stays in the bottom corner of the window and - **What an existing site's visitors see: the "cookie settings" button stays in the bottom corner of the window and
@@ -58,11 +95,11 @@ once there are more than 20.
`<CookieButton avoid={COOKIE_BUTTON_AVOID} />` (on `SiteProviders`: `cookieButton={…}`). A site that passes a `<CookieButton avoid={COOKIE_BUTTON_AVOID} />` (on `SiteProviders`: `cookieButton={…}`). A site that passes a
selector in `avoid` keeps its behaviour. A project e2e test that expects the button above the footer, or an exact selector in `avoid` keeps its behaviour. A project e2e test that expects the button above the footer, or an exact
footer height after a decision, needs an update. footer height after a decision, needs an update.
- The reference site (and every new site from `iapl create`): `Pages`, `Posts`, `CaseStudies`, `Media` and the
### Added `Header`, `Footer`, `Company` globals have their own write rules (`adminOrEditor`) instead of Payload's default.
- `CookieButton` prop `reserve` (the block that gets the room; `false` = off); `COOKIE_BUTTON_RESERVE`, Existing sites: nothing changes; the doctor's `visitor-writes` names what to add where it matters.
`COOKIE_BUTTON_SPACE_ATTRIBUTE`, `reserveCookieButtonSpace` (`/client`, type `CookieButtonSpaceOptions`); - Not built (owner's Q3 answer (a), planned for 2.0): a plugin-wide default for the project's own entities and for
`consentDecidedScript` (root); the token `--ipal-cookie-button-space`. Payload's `payload-locked-documents`.
## 1.17.1 — security fixes from the IAWL review; the panel's sign-in look; the sending method is chosen ## 1.17.1 — security fixes from the IAWL review; the panel's sign-in look; the sending method is chosen
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@intecion/ipal-kit", "name": "@intecion/ipal-kit",
"version": "1.17.1", "version": "1.17.2",
"description": "Intecion Advanced Payload Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.", "description": "Intecion Advanced Payload Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
+1 -1
View File
@@ -7,4 +7,4 @@
* `/_next/static/media/`. Written by `node scripts/write-version.mjs` (the `version` script of * `/_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. * package.json runs it on `pnpm version …`); test/version.test.ts fails when the two differ.
*/ */
export const PLUGIN_VERSION = '1.17.1' export const PLUGIN_VERSION = '1.17.2'