Overrides for Payload's mongoose and happy-dom advisories; doctor rule transitive-min

@payloadcms/db-mongodb pins mongoose 8.24.1 (one critical, two high, two moderate
advisories, fixed by 8.24.7) and @lexical/headless 0.50 brings happy-dom 20.x (two
high, fixed by 21.0.4). Payload 3.93.0 fixes neither.

- reference/package.json (and so the starter): pnpm.overrides for mongoose
  (~8.24.10) and happy-dom (^21.0.4); pnpm audit --prod on the reference is clean
- root package.json: the happy-dom override for the plugin's own dev tree
- ipal-doctor: transitive-min reports mongoose 8.x < 8.24.7 (error) and
  happy-dom < 21.0.4 (warning) from the lockfile and prints the override line;
  DoctorContext.installedAll(name)
- AGENT.md §4 item 12, ipal-setup, ipal-upgrade, doctor.md, README, CHANGELOG

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-17 00:01:58 +01:00
co-authored by Claude Fable 5.2
parent 7c034a07ef
commit de8362820f
15 changed files with 209 additions and 36 deletions
+33
View File
@@ -8,6 +8,39 @@ 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
- **`mongoose` and `happy-dom` overrides for Payload's own dependencies.** `@payloadcms/db-mongodb` pins `mongoose`
8.24.1 exactly (still so in Payload 3.93.0). 8.x below 8.24.7 has five advisories published 2026-11-10:
[GHSA-pcrw-h46h-c93h](https://github.com/advisories/GHSA-pcrw-h46h-c93h) (critical, `sanitizeFilter` not applied on
`countDocuments`; fixed in 8.24.3), [GHSA-gg4r-jv3p-qx3c](https://github.com/advisories/GHSA-gg4r-jv3p-qx3c) and
[GHSA-8332-j7wj-wjw4](https://github.com/advisories/GHSA-8332-j7wj-wjw4) (high),
[GHSA-wr5m-5jph-8m96](https://github.com/advisories/GHSA-wr5m-5jph-8m96) and
[GHSA-6972-9mcm-vhwj](https://github.com/advisories/GHSA-6972-9mcm-vhwj) (moderate) — all fixed in 8.24.7.
`@payloadcms/richtext-lexical` → `@lexical/headless` 0.50 brings `happy-dom` 20.x, which has
[GHSA-c8p4-j97h-3vg8](https://github.com/advisories/GHSA-c8p4-j97h-3vg8) (high, fixed in 21.0.0) and
[GHSA-834v-8h66-3h79](https://github.com/advisories/GHSA-834v-8h66-3h79) (high, fixed in 21.0.4). The plugin has no
part in either; only the project's lockfile can lift them. The reference site and the project starter now carry
`"mongoose@>=8 <8.24.7": "~8.24.10"` and `"happy-dom@<21.0.4": "^21.0.4"` in `pnpm.overrides`; with them
`pnpm audit --prod` on the reference site reports no known vulnerabilities, and its seed, production build, smoke
tests and doctor pass. The plugin forces neither override on a project.
### Added
- **ipal-doctor `transitive-min`** (group `versions`): reports a `mongoose` 8.x below 8.24.7 (error) and a `happy-dom`
below 21.0.4 (warning) anywhere in the dependency tree, read from `pnpm-lock.yaml`, and prints the exact
`pnpm.overrides` line. Silence it in `ipal-doctor.json` like any rule
(`"transitive-min": { "off": true, "reason": "…" }`). `DoctorContext.installedAll(name)` is the building block for
your own rules on transitive packages.
### Changed
- AGENT.md §4 item 12, the `ipal-setup` and `ipal-upgrade` skills, doctor.md and the README list five overrides.
### What projects must update
- **Every MongoDB site:** add the two lines to `pnpm.overrides` in `package.json`, `pnpm install`, `pnpm build`, commit
`package.json` and the lockfile, redeploy on Coolify. No data change, no migration. `pnpm audit --prod` → no high or
critical; `pnpm exec ipal-doctor` → no `transitive-min` finding. `pnpm ipal:skills` for the updated skills.
## 1.16.1
### Security
+16 -2
View File
@@ -516,13 +516,25 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
finding; `pnpm dev` prints no security-upgrade warning.
12. **No open production advisories.** Node.js 20 or later (the plugin's `nodemailer` 10 requires it). Run
`pnpm audit --prod`. The plugin's own dependencies are clean; what remains comes from Payload's tree, which only
the project's lockfile can fix. With `payload` 3.90.x three packages are pinned exactly and need `pnpm.overrides`
the project's lockfile can fix. With `payload` 3.90.x five packages are pinned below a fix and need `pnpm.overrides`
next to the `@payloadcms/*` ones:
```json
"dompurify@<3.4.17": "^3.4.17",
"graphql-scalars@<2.0.1": "^2.0.1",
"happy-dom@<21.0.4": "^21.0.4",
"mongoose@>=8 <8.24.7": "~8.24.10",
"undici@>=7 <7.30.1": "^7.30.1"
```
`mongoose` (MongoDB sites — every site that uses `@payloadcms/db-mongodb`): the adapter pins 8.24.1 exactly, up
to the latest Payload (3.93.0). 8.x below 8.24.7 has five advisories: GHSA-pcrw-h46h-c93h (critical,
`sanitizeFilter` not applied on `countDocuments`, fixed in 8.24.3), GHSA-gg4r-jv3p-qx3c and GHSA-8332-j7wj-wjw4
(high), GHSA-wr5m-5jph-8m96 and GHSA-6972-9mcm-vhwj (moderate), all fixed in 8.24.7. The override stays on the
8.24 patch line (`~8.24.10`), the line Payload itself tests; the reference site seeds, builds and passes its smoke
tests on it. `happy-dom` comes from `@payloadcms/richtext-lexical` → `@lexical/headless` 0.50 (`^20.9.0`); every
20.x has GHSA-c8p4-j97h-3vg8 (high, SSRF when parsing untrusted HTML, fixed in 21.0.0) and GHSA-834v-8h66-3h79
(high, host code execution, fixed in 21.0.4). 21 is a major, but only `@lexical/headless/dom` (`withDOM`) loads
it — Payload 3.90 never imports that entry, and Lexical 0.53 itself moved to `^21.0.4`; `withDOM` HTML parsing and
export are checked on 21.0.4. Both overrides stop matching once Payload ships a fixed version — remove them then.
`undici` comes from `payload` (3.92.1 and later already ship 7.30.1), `dompurify` from the admin code editor
(`@payloadcms/ui` → `monaco-editor`, which pins 3.2.7). `graphql-scalars` comes from `@payloadcms/graphql`, which
pins 1.22.2 up to the latest Payload (3.92.1); every version up to 2.0.0 has a high ReDoS advisory in the
@@ -533,7 +545,9 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
lockfile picks up the fix; add an override like the ones above only if it does not. These are recommendations —
the plugin forces none of them. Never add a project dependency on `nodemailer` or `@types/nodemailer`.
**Check:** `pnpm audit --prod` → no high or critical (only the `deepmerge` low may remain);
`pnpm why undici dompurify graphql-scalars` → only the fixed versions; with GraphQL in use, a query that reads a
`pnpm why undici dompurify graphql-scalars mongoose happy-dom` → only the fixed versions (mongoose 8.24.7 or
later, happy-dom 21.0.4 or later); `pnpm exec ipal-doctor` → no `transitive-min` finding; after the mongoose
override run `pnpm build`, open the panel and save a document; with GraphQL in use, a query that reads a
`createdAt` (DateTime) and filters on `email` (EmailAddress) returns data.
---
+4 -1
View File
@@ -97,7 +97,10 @@ pnpm add @intecion/ipal-kit @payloadcms/plugin-seo @payloadcms/plugin-form-build
GHSA-mfr8-8qww-v76h — AGENT.md §4 item 11): `pnpm add [email protected] [email protected] sharp@^0.35.5` when
create-payload-app gave you an older one.
**Node.js 20 or later** (the plugin's `nodemailer` 10 requires it). After the install, `pnpm audit --prod` → no high or
critical; with `payload` 3.90.x add the `dompurify`, `graphql-scalars` and `undici` overrides from AGENT.md §4 item 12.
critical; with `payload` 3.90.x add the `dompurify`, `graphql-scalars`, `happy-dom`, `mongoose` and `undici` overrides
from AGENT.md §4 item 12 (`"mongoose@>=8 <8.24.7": "~8.24.10"` lifts the 8.24.1 that `@payloadcms/db-mongodb` pins —
one critical and two high advisories; `"happy-dom@<21.0.4": "^21.0.4"` fixes two high ones). `pnpm exec ipal-doctor`
→ no `transitive-min` finding.
`nodemailer`, `lucide-react`, `slugify`, `server-only` come with the plugin — do not add them (your own
`lucide-react` only `~0.400.0`). In `package.json`: pin every `@payloadcms/*` (ui, next, db-*, richtext-lexical,
plugin-seo, plugin-form-builder, storage-s3) in `pnpm.overrides` **to the exact `payload` version**, then
+11 -2
View File
@@ -88,8 +88,17 @@ the banner → `<CookieBanner settings="detailed">` and remove the copy. With `d
prints no security-upgrade warning.
**Every upgrade — dependency advisories** (AGENT.md §4 item 12): `pnpm audit --prod`; with `payload` 3.90.x add the
`dompurify`, `graphql-scalars` and `undici` overrides, `pnpm install`, audit again. **Check:** no high or critical (the
`deepmerge` low has no fix yet).
`dompurify`, `graphql-scalars`, `happy-dom`, `mongoose` and `undici` overrides to `pnpm.overrides`, `pnpm install`, audit
again. MongoDB sites need the `mongoose` one now: `@payloadcms/db-mongodb` pins 8.24.1 (up to Payload 3.93.0), which has
a critical advisory (GHSA-pcrw-h46h-c93h) and four more, all fixed in 8.24.7:
```json
"happy-dom@<21.0.4": "^21.0.4",
"mongoose@>=8 <8.24.7": "~8.24.10"
```
Then `pnpm install`, `pnpm build`, commit `package.json` and the lockfile, redeploy on Coolify (the new image ships the
fixed packages; no data or schema change, no migration). **Check:** `pnpm audit --prod` → no high or critical (the
`deepmerge` low has no fix yet); `pnpm why mongoose happy-dom` → 8.24.7 or later, 21.0.4 or later;
`pnpm exec ipal-doctor` → no `transitive-min` finding; the panel opens and a document saves.
**→ 1.14.0 (PROGRAMISTA §6, items 48–49; CHANGELOG "What projects must update" — do all 8, in order):**
1. `pnpm payload generate:importmap` — `@intecion/ipal-kit/admin#FaviconCheck` (hint under Site settings → Site icon)
+1
View File
@@ -81,6 +81,7 @@ Turn off: `ipalKit({ doctor: false })`. Adapt: `ipalKit({ doctor: { tokenVar: 'M
| | `plugin-latest` | warning; error two or more minors behind | the installed plugin is the newest on the team registry (registry) |
| | `next-min` | error | `next` ≥ 16.4.5 (below 16.4.1: RCE/DoS advisories; 16.3.0–16.4.4: GHSA-mfr8-8qww-v76h); `eslint-config-next` on the same minor (warning) |
| | `sharp-min` | error | `sharp` ≥ 0.35.5 |
| | `transitive-min` | error (`mongoose`), warning (`happy-dom`) | packages Payload pins below a security fix, in any depth of the tree (read from `pnpm-lock.yaml`, else `node_modules/.pnpm`): `mongoose` 8.x ≥ 8.24.7 (GHSA-pcrw-h46h-c93h and four more), `happy-dom` ≥ 21.0.4 (GHSA-c8p4-j97h-3vg8, GHSA-834v-8h66-3h79). The fix it prints is the `pnpm.overrides` line from AGENT.md §4 item 12 |
| | `node-22` | warning | `engines.node` only 22 (`">=22 <23"`), `.nvmrc` / `.node-version` = 22; with `--deep`, the running Node |
| | `pnpm-pinned` | info | `packageManager` is set |
| | `deps-audit` | error on critical/high, info on moderate/low | `pnpm audit --prod` (registry) |