From 304328852eecd059e39a96e9f7b5d3dbf55464f7 Mon Sep 17 00:00:00 2001 From: maxffarrell <72176209+maxffarrell@users.noreply.github.com> Date: Wed, 21 Oct 2026 22:13:24 -0500 Subject: [PATCH] Require patched Node.js 26 for CVE-2026-111497 --- .node-version | 2 +- .npmrc | 1 + SETUP.md | 2 +- package.json | 5 +++-- pnpm-workspace.yaml | 3 +++ scripts/check-node.mjs | 11 +++++++++++ 6 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .npmrc create mode 100644 scripts/check-node.mjs diff --git a/.node-version b/.node-version index 6f4247a..63f87c2 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -26 +26.12.1 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/SETUP.md b/SETUP.md index fd1972d..3d513f9 100644 --- a/SETUP.md +++ b/SETUP.md @@ -56,7 +56,7 @@ Existing databases that previously applied `0002_seed.sql` need no rollback, res ## Local development -Use Node.js 22.17 or newer and pnpm 12 or newer. For local development, install dependencies and use the placeholder resource configuration; no cloud resources need to be provisioned: +Use Node.js 26.12.1 or newer on the 26.x line and pnpm 12 or newer. For local development, install dependencies and use the placeholder resource configuration; no cloud resources need to be provisioned: ```sh pnpm db:migrate:local diff --git a/package.json b/package.json index 54617f1..9a9087d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "packageManager": "pnpm@12.4.1", "engines": { - "node": ">=22.17.0", + "node": "^26.12.1", "pnpm": ">=12.0.0" }, "imports": { @@ -30,7 +30,8 @@ "db:seed:local": "wrangler d1 execute DB --local --file=seeds/starter.sql", "db:seed:remote": "wrangler d1 execute DB --remote --file=seeds/starter.sql", "plugin:package": "node scripts/package-plugin.mjs", - "publish:static": "node scripts/publish-static.mjs" + "publish:static": "node scripts/publish-static.mjs", + "preinstall": "node scripts/check-node.mjs" }, "dependencies": { "@cloudflare/workers-oauth-provider": "1.2.3", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ecec0c1..f982a0f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -30,3 +30,6 @@ overrides: postcss@<=8.5.22: ^8.5.23 sharp@<0.35.0: ^0.35.0 undici@>=7.0.0 <7.29.0: ^8.0.0 + +# CVE-2026-111497: require patched Node runtimes. +engineStrict: true diff --git a/scripts/check-node.mjs b/scripts/check-node.mjs new file mode 100644 index 0000000..22c53ad --- /dev/null +++ b/scripts/check-node.mjs @@ -0,0 +1,11 @@ +// CVE-2026-111497 is fixed in these Node.js security releases. +const [major, minor, patch] = process.versions.node.split(".").map(Number); +const minimum = new Map([[26, [12, 1]]]).get(major); +if ( + !Number.isInteger(patch) || + !minimum || + minor < minimum[0] || + (minor === minimum[0] && patch < minimum[1]) +) { + throw new Error("CVE-2026-111497: use Node.js 26.12.1+ on the 26.x line."); +}