Dependency advisories: nodemailer 10, overrides for Payload's pinned deps
- nodemailer ^8.0.1 -> ^10.2.1 (advisories up to 10.1.3); drop @types/nodemailer, nodemailer 10 ships its own types. Node engines >=20.9.0 (nodemailer 10 needs 20+). - pnpm.overrides (repo only, not passed to projects) for packages in payload 3.90.2's tree: undici and dompurify are exact-pinned upstream; fast-uri, js-yaml, browserslist, source-map-js, fast-copy, baseline-browser-mapping raised to fixed minimums. pnpm audit --prod: 19 high / 35 moderate / 11 low -> 0. - Tests: SMTP over a local SMTP socket with real nodemailer (panelSmtpAdapter, sendEmail, unreachable server status), Microsoft Graph and Graph->SMTP fallback via mailAdapter; real payloadTotp through ipalKit, plus a check that payload-2fa resolves the project's payload. - Docs: email.md, AGENT.md §4 item 12, ipal-setup, ipal-upgrade, README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
54fb57b7a9
commit
007a0a3ae6
@@ -416,6 +416,20 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
|
||||
15.x line. Pin `next` and `eslint-config-next` to the same 16.4.x (≥ 16.4.1) and make sure `sharp` resolves to
|
||||
0.35.5 or later (`pnpm why sharp`). The plugin's peer range stays open (`next >=15`) — the minimum is yours to keep.
|
||||
**Check:** `pnpm ls next sharp` → next ≥ 16.4.1, sharp ≥ 0.35.5; `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 two packages are pinned exactly and need `pnpm.overrides`
|
||||
next to the `@payloadcms/*` ones:
|
||||
```json
|
||||
"dompurify@<3.4.17": "^3.4.17",
|
||||
"undici@>=7 <7.30.1": "^7.30.1"
|
||||
```
|
||||
`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). Everything else in the report (`fast-uri`, `js-yaml`,
|
||||
`browserslist`, `source-map-js`, `fast-copy`, `baseline-browser-mapping`) is a range: `pnpm update` or a fresh
|
||||
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; `pnpm why undici dompurify` → only the fixed versions.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ pnpm add @intecion/ipal-kit @payloadcms/plugin-seo @payloadcms/plugin-form-build
|
||||
```
|
||||
**Next.js 16.4.1 or later** (minimum safe version: 16.0.0–16.4.0 have critical advisories, AGENT.md §4 item 11):
|
||||
`pnpm add next@^16.4.1 eslint-config-next@^16.4.1 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` and `undici` overrides from AGENT.md §4 item 12.
|
||||
`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
|
||||
|
||||
@@ -86,12 +86,21 @@ the banner → `<CookieBanner settings="detailed">` and remove the copy. With `d
|
||||
`pnpm add next@^16.4.1 eslint-config-next@^16.4.1 sharp@^0.35.5`, `rm -rf .next`, build, redeploy on Coolify
|
||||
(a new image ships the fixed next and sharp). **Check:** `pnpm dev` 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` and `undici` overrides, `pnpm install`, audit again. **Check:** no high or critical.
|
||||
|
||||
**→ after 1.13.0 (admin follow-ups):** `pnpm payload generate:importmap` — new panel component
|
||||
`@intecion/ipal-kit/admin#FaviconCheck` (hint under Site settings → Site icon). **Check:** pick a 32×32 PNG as the
|
||||
site icon → a warning appears under the field; saving still works. Nothing else to change: the statistics tab title,
|
||||
the cookie scanner's integration names and the maintenance notice's close button now follow the language by themselves
|
||||
(`<ConstructionNotice mode={await getConstructionMode(locale)} />` already passes it).
|
||||
|
||||
**→ after 1.13.0 (dependency advisories):** the plugin now brings `nodemailer` 10 (was 8), which needs **Node.js 20 or
|
||||
later** — check the Coolify build image and `.nvmrc` / `engines`. Remove `nodemailer` and `@types/nodemailer` from the
|
||||
project's own `package.json` if someone added them (the plugin's copy is the one `mailAdapter` uses). Then the audit step
|
||||
above. **Check:** Site integrations → E-mail sending → send a test e-mail over SMTP (and over Microsoft Graph when the
|
||||
project uses it); `pnpm audit --prod` → no high or critical.
|
||||
|
||||
## 2. Inventory (no code changes)
|
||||
For **every** item in the PROGRAMISTA §6 table show evidence (grep / file) of whether
|
||||
it applies to the project. Run the **ipal-audit** skill (`--quick`) and attach the result.
|
||||
|
||||
+9
-2
@@ -10,8 +10,15 @@ and the editor picks the transport in the panel. A separate `sendEmail` helper (
|
||||
|
||||
## Dependency
|
||||
|
||||
`nodemailer` (`^8`) is already in the plugin's `dependencies` — the project does not need to
|
||||
install it. Graph is plain `fetch`, no extra packages.
|
||||
`nodemailer` (`^10.2.1`) is already in the plugin's `dependencies` — the project does not need to
|
||||
install it (nodemailer 10 ships its own types, so `@types/nodemailer` is not needed either). Graph is plain
|
||||
`fetch`, no extra packages.
|
||||
|
||||
- **Node.js 20 or later** — nodemailer 10 requires it (the Coolify images run Node 22).
|
||||
- **Why `^10.2.1`:** every nodemailer up to 10.1.3 has open advisories (address parser ReDoS, recipient-domain
|
||||
bypass, `raw`/`resolveContent` file access). Do not pin an older nodemailer in the project.
|
||||
- **Since nodemailer 9**, attachments given as an `href`/`path` URL are fetched with TLS certificate validation.
|
||||
A mail with an attachment from a host with a self-signed certificate now fails instead of sending.
|
||||
|
||||
## Config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user