fix(security): update runtime baseline and vulnerable dependencies
Require patched Node.js releases and refresh affected application and build dependencies. Align installation requirements, startup checks, and release workflows with the security baseline.
This commit is contained in:
30 files changed
+420
-342
No files matched your search
@@ -61,9 +61,9 @@
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@
|
||||
"@types/node": "catalog:",
|
||||
"@types/semver": "7.7.1",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@zxcvbn-ts/core": "^4.1.2",
|
||||
@@ -118,6 +118,6 @@
|
||||
"semver": "7.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -57,15 +57,15 @@
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@types/node": "catalog:",
|
||||
"cross-env": "^10.1.0",
|
||||
"hono": "^4.12.34",
|
||||
"hono": "^4.13.11",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vite-plugin-cp": "^6.0.3",
|
||||
"vitest": "^4.1.4",
|
||||
"vitest": "4.1.11",
|
||||
"@snowluma/sqlite": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createRequire } from 'node:module';
|
||||
import { readFileSync, readdirSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
@@ -9,17 +10,48 @@ const { SUPPORTED_NODE_RANGE, isSupportedNodeVersion } =
|
||||
};
|
||||
|
||||
describe('runtime Node.js preflight', () => {
|
||||
it('accepts the documented minimum and newer versions', () => {
|
||||
expect(SUPPORTED_NODE_RANGE).toBe('>=24');
|
||||
expect(isSupportedNodeVersion('24.0.0')).toBe(true);
|
||||
expect(isSupportedNodeVersion('24.21.0')).toBe(true);
|
||||
expect(isSupportedNodeVersion('26.0.0')).toBe(true);
|
||||
it.each(['24.22.1', '24.22.2', '24.23.0', '24.22.1+vendor.1', '26.12.1', '26.13.0', '27.0.0'])(
|
||||
'accepts patched stable Node.js %s',
|
||||
(version) => {
|
||||
expect(isSupportedNodeVersion(version)).toBe(true);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
'22.23.4',
|
||||
'23.99.99',
|
||||
'24.0.0',
|
||||
'24.21.0',
|
||||
'24.22.0',
|
||||
'25.99.99',
|
||||
'26.0.0',
|
||||
'26.11.99',
|
||||
'26.12.0',
|
||||
'24.22.1-rc.1',
|
||||
'26.12.1-rc.1',
|
||||
'not-a-version',
|
||||
])('rejects unpatched, unsupported or malformed Node.js %s', (version) => {
|
||||
expect(isSupportedNodeVersion(version)).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects older and malformed versions', () => {
|
||||
expect(isSupportedNodeVersion('22.99.99')).toBe(false);
|
||||
expect(isSupportedNodeVersion('23.99.99')).toBe(false);
|
||||
expect(isSupportedNodeVersion('21.99.99')).toBe(false);
|
||||
expect(isSupportedNodeVersion('not-a-version')).toBe(false);
|
||||
it('keeps workspace requirements and the bundled runtime baseline aligned', () => {
|
||||
expect(SUPPORTED_NODE_RANGE).toBe('^24.22.1 || >=26.12.1');
|
||||
const root = new URL('../../../', import.meta.url);
|
||||
const packages = readdirSync(new URL('packages/', root), { withFileTypes: true });
|
||||
const manifests = [
|
||||
new URL('package.json', root),
|
||||
...packages
|
||||
.filter((entry) => entry.isDirectory())
|
||||
.map((entry) => new URL(`packages/${entry.name}/package.json`, root)),
|
||||
];
|
||||
|
||||
for (const manifest of manifests) {
|
||||
const pkg = JSON.parse(readFileSync(manifest, 'utf8'));
|
||||
expect(pkg.engines.node, manifest.pathname).toBe(SUPPORTED_NODE_RANGE);
|
||||
}
|
||||
|
||||
const baseline = readFileSync(new URL('.node-version', root), 'utf8').trim();
|
||||
expect(baseline).toBe('24.22.1');
|
||||
expect(isSupportedNodeVersion(baseline)).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -40,7 +40,7 @@
|
||||
"qq"
|
||||
],
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.0.0"
|
||||
"@modelcontextprotocol/sdk": "^1.32.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@snowluma/onebot": "workspace:*",
|
||||
@@ -48,10 +48,10 @@
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -119,9 +119,9 @@
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,6 @@
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -121,9 +121,9 @@
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@
|
||||
"@types/node": "catalog:",
|
||||
"tsup": "^8.5.0",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const SUPPORTED_NODE_RANGE = '>=24';
|
||||
const SUPPORTED_NODE_RANGE = '^24.22.1 || >=26.12.1';
|
||||
|
||||
function parseNodeVersion(version) {
|
||||
const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(version);
|
||||
const match = /^(\d+)\.(\d+)\.(\d+)(?:\+[0-9A-Za-z.-]+)?$/.exec(version);
|
||||
return match ? match.slice(1, 4).map(Number) : null;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,10 @@ function isSupportedNodeVersion(version) {
|
||||
const actual = parseNodeVersion(version);
|
||||
if (!actual) return false;
|
||||
|
||||
const [major] = actual;
|
||||
return major >= 24;
|
||||
const [major, minor, patch] = actual;
|
||||
if (major === 24) return minor > 22 || (minor === 22 && patch >= 1);
|
||||
if (major === 26) return minor > 12 || (minor === 12 && patch >= 1);
|
||||
return major > 26;
|
||||
}
|
||||
|
||||
if (require.main === module && !isSupportedNodeVersion(process.versions.node)) {
|
||||
|
||||
@@ -8,7 +8,7 @@ if [[ -x "./node" ]]; then
|
||||
else
|
||||
NODE_BIN="$(command -v node || true)"
|
||||
if [[ -z "$NODE_BIN" ]]; then
|
||||
echo "error: 'node' not found on PATH and no bundled ./node; install Node.js 24+." >&2
|
||||
echo "error: 'node' not found on PATH and no bundled ./node; install Node.js 24.22.1 (24.x) or >=26.12.1." >&2
|
||||
exit 127
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
"main": "index.mjs",
|
||||
"description": "SnowLuma runtime distribution manifest: ships into dist/ (launcher.bat, package.json, native/*.dll, native/*.node). All native bindings ship as standalone `.node` files in `dist/native/` — loaded via `process.dlopen()` / `createRequire().require()` from inside the bundle. There are intentionally NO runtime npm dependencies; production artifacts are self-contained.",
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Require patched Node.js releases: 24.22.1 or newer in the 24.x line, or 26.12.1 and newer.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
Upgrade to Node.js 24 or newer before updating the SDK. SDK and application versions are released together.
|
||||
|
||||
@@ -11,6 +11,8 @@ The SDK follows SemVer for its public package surface:
|
||||
|
||||
SDK and application versions are synchronized by `pnpm bump <version>` from the repository root.
|
||||
|
||||
The current Node.js requirement is `^24.22.1 || >=26.12.1`. Use the repository's `.node-version` for development and builds.
|
||||
|
||||
- Major: removes or changes a public export, changes runtime behavior incompatibly, changes supported Node version, or changes package subpaths.
|
||||
- Minor: adds new public API, supports new SnowLuma actions, adds optional parameters, or adds error subclasses.
|
||||
- Patch: fixes bugs, improves docs, narrows implementation details without breaking public types, or updates action metadata without changing call signatures.
|
||||
|
||||
@@ -85,11 +85,11 @@
|
||||
"access": "public"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,9 @@
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19.0.0",
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@
|
||||
"typescript": "catalog:",
|
||||
"typescript-eslint": "^8.58.2",
|
||||
"vite": "catalog:",
|
||||
"vitest": "^4.1.4"
|
||||
"vitest": "4.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
"node": "^24.22.1 || >=26.12.1"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user