fix: sichere Brotli-Laufzeit ab und erhöhe Patchversionen
Some checks failed
Code Analysis and Production Deploy / analyze (push) Successful in 7m23s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Failing after 2m27s

This commit is contained in:
Torsten Schulz (local)
2026-10-27 15:32:16 +01:00
parent bf74d41773
commit 7a991a50c7
6 changed files with 35 additions and 6 deletions

2
.nvmrc
View File

@@ -1 +1 @@
22 24.22.1

View File

@@ -1,3 +1,4 @@
import './scripts/require-safe-node.cjs';
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: process.env.NODE_ENV !== 'production' }, devtools: { enabled: process.env.NODE_ENV !== 'production' },

6
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.8.13", "version": "1.9.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.8.13", "version": "1.9.1",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@pinia/nuxt": "^0.11.2", "@pinia/nuxt": "^0.11.2",
@@ -44,7 +44,7 @@
"vue-eslint-parser": "^10.2.0" "vue-eslint-parser": "^10.2.0"
}, },
"engines": { "engines": {
"node": ">=22.12.0", "node": "^22.23.4 || ^24.22.1 || ^26.12.1",
"npm": "10.9.7" "npm": "10.9.7"
} }
}, },

View File

@@ -1,11 +1,11 @@
{ {
"name": "harheimertc-website", "name": "harheimertc-website",
"version": "1.9.0", "version": "1.9.1",
"description": "Moderne Webseite für den Harheimer Tischtennis Club", "description": "Moderne Webseite für den Harheimer Tischtennis Club",
"private": true, "private": true,
"type": "module", "type": "module",
"engines": { "engines": {
"node": ">=22.12.0", "node": "^22.23.4 || ^24.22.1 || ^26.12.1",
"npm": "10.9.7" "npm": "10.9.7"
}, },
"scripts": { "scripts": {

View File

@@ -0,0 +1,22 @@
// CVE-2026-111497: Node's bundled Brotli decoder must include the security fix.
// Check Node versions: patched releases can still report Brotli 1.2.0.
// https://nodejs.org/en/blog/vulnerability/october-2026-security-releases
'use strict';
function requireSafeNode() {
const [major, minor, patch] = process.versions.node.split('.').map(Number);
const minimum = { 22: [23, 4], 24: [22, 1], 26: [12, 1] }[major];
const patched = minimum && (minor > minimum[0] ||
(minor === minimum[0] && patch >= minimum[1]));
if (!patched) {
throw new Error(
`CVE-2026-111497: Node.js ${process.versions.node} is not an approved patched runtime. ` +
'Use Node.js 22.23.4+, 24.22.1+ or 26.12.1+ within those release lines. ' +
'Recommended: nvm install && nvm use (see .nvmrc). Restart all server/PM2 processes after upgrading.'
);
}
}
requireSafeNode();
module.exports = requireSafeNode;

View File

@@ -0,0 +1,6 @@
import requireSafeNode from '../../scripts/require-safe-node.cjs';
// An explicit call keeps the guard in Nitro's production bundle.
requireSafeNode();
export default defineNitroPlugin(() => {});