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
+43
View File
@@ -8,6 +8,28 @@ export const NEXT_MIN_SAFE = '16.4.5'
/** The version the plugin, the reference site and the starter use. */
export const NEXT_RECOMMENDED = '16.4.6'
/**
* Packages from Payload's own dependency tree that Payload pins below a security fix (AGENT.md §4 item 12). Only the
* project's lockfile can lift them, with a `pnpm.overrides` entry. `major` limits the check to the line Payload uses.
*/
export const TRANSITIVE_MIN_SAFE: { major?: number; min: string; name: string; override: string; severity: 'error' | 'warning'; why: string }[] = [
{
name: 'mongoose',
major: 8,
min: '8.24.7',
override: '"mongoose@>=8 <8.24.7": "~8.24.10"',
severity: 'error',
why: 'GHSA-pcrw-h46h-c93h (critical, sanitizeFilter not applied on countDocuments) and four more; @payloadcms/db-mongodb pins 8.24.1',
},
{
name: 'happy-dom',
min: '21.0.4',
override: '"happy-dom@<21.0.4": "^21.0.4"',
severity: 'warning',
why: 'GHSA-c8p4-j97h-3vg8 and GHSA-834v-8h66-3h79 (high); comes with @payloadcms/richtext-lexical → @lexical/headless',
},
]
export const versionRules: DoctorRule[] = [
{
id: 'plugin-installed',
@@ -58,6 +80,27 @@ export const versionRules: DoctorRule[] = [
group: 'versions',
source: 'static',
},
{
id: 'transitive-min',
check: (ctx) => {
const out: RuleFinding[] = []
for (const dep of TRANSITIVE_MIN_SAFE) {
const old = ctx.installedAll(dep.name).filter((v) => (dep.major === undefined || parseVersion(v)?.[0] === dep.major) && lt(v, dep.min))
if (old.length) {
out.push({
file: 'package.json',
fix: `add ${dep.override} to pnpm.overrides in package.json, then pnpm install (AGENT.md §4 item 12)`,
message: `${dep.name} ${old.join(', ')} < ${dep.min} — ${dep.why}`,
severity: dep.severity,
})
}
}
return out
},
docs: 'docs/agent/AGENT.md#4-next-16--rendering-seo-build',
group: 'versions',
source: 'static',
},
{
id: 'node-22',
check: (ctx) => {