fix: sichere Brotli-Laufzeit ab und erhöhe Patchversionen
All checks were successful
Deploy to production / deploy (push) Successful in 2m23s

This commit is contained in:
Torsten Schulz (local)
2026-10-27 15:32:16 +01:00
parent 67ecac64aa
commit 6578ccdeed
10 changed files with 45 additions and 6 deletions

1
backend/.nvmrc Normal file
View File

@@ -0,0 +1 @@
24.22.1

View File

@@ -1,3 +1,4 @@
import './scripts/require-safe-node.cjs';
import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';

View File

@@ -1,3 +1,4 @@
import './scripts/require-safe-node.cjs';
import WebSocket, { WebSocketServer } from 'ws';
import https from 'https';
import fs from 'fs';

View File

@@ -1,12 +1,12 @@
{
"name": "backend",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "backend",
"version": "1.0.0",
"version": "1.0.1",
"license": "ISC",
"dependencies": {
"@gltf-transform/cli": "^4.3.0",
@@ -38,6 +38,9 @@
},
"devDependencies": {
"sequelize-cli": "^6.6.5"
},
"engines": {
"node": "^22.23.4 || ^24.22.1 || ^26.12.1"
}
},
"node_modules/@asamuzakjp/css-color": {

View File

@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "1.0.0",
"version": "1.0.1",
"description": "Nach Änderungen an dependencies: npm install ausführen und package-lock.json committen (npm ci im Deploy).",
"type": "module",
"main": "index.js",
@@ -58,5 +58,8 @@
"sequelize": {
"uuid": "14.0.0"
}
},
"engines": {
"node": "^22.23.4 || ^24.22.1 || ^26.12.1"
}
}

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

@@ -1,3 +1,4 @@
import './scripts/require-safe-node.cjs';
import './config/loadEnv.js'; // .env deterministisch laden
import http from 'http';