@corca-org/ceal 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/launch.js +48 -1
- package/package.json +7 -7
package/bin/launch.js
CHANGED
|
@@ -12,7 +12,54 @@ import { fileURLToPath } from "node:url";
|
|
|
12
12
|
|
|
13
13
|
const launcherRequire = createRequire(import.meta.url);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Patched Node release lines closing CVE-2026-111497 (Node.js
|
|
17
|
+
* bundled-Brotli decoder remote code execution). This table is a projection of
|
|
18
|
+
* the one owner in gateway/scripts/runtime-artifact-contract.ts
|
|
19
|
+
* (PATCHED_NODE_LINE_MINIMUMS); gateway/test/gateway-runtime-node-floor.test.ts
|
|
20
|
+
* pins every value and the refusal line below to that owner, because the
|
|
21
|
+
* published copy of this file is self-contained and cannot import it.
|
|
22
|
+
*/
|
|
23
|
+
export const PATCHED_NODE_LINE_MINIMUMS = { 22: "22.23.4", 24: "24.22.1", 26: "26.12.1" };
|
|
24
|
+
|
|
25
|
+
/** The one refusal line every Node startup guard prints before any spawn or decode. */
|
|
26
|
+
export function patchedNodeRefusalLine(selected) {
|
|
27
|
+
return `Node ${selected} is refused before decoding: CVE-2026-111497 (Node.js bundled-Brotli decoder remote code execution) affects every release below ${PATCHED_NODE_LINE_MINIMUMS[22]} / ${PATCHED_NODE_LINE_MINIMUMS[24]} / ${PATCHED_NODE_LINE_MINIMUMS[26]}; run a patched release.`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function nodeParts(version) {
|
|
31
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:[+-].*)?$/u.exec(String(version));
|
|
32
|
+
if (match === null) return null;
|
|
33
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function partsAtLeast(parts, minimum) {
|
|
37
|
+
const floor = nodeParts(minimum);
|
|
38
|
+
if (floor === null) return false;
|
|
39
|
+
if (parts[1] !== floor[1]) return parts[1] > floor[1];
|
|
40
|
+
return parts[2] >= floor[2];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Whether a Node version carries the CVE-2026-111497 Brotli fix. */
|
|
44
|
+
export function isPatchedNodeReleaseVersion(version) {
|
|
45
|
+
const parts = nodeParts(version);
|
|
46
|
+
if (parts === null) return false;
|
|
47
|
+
if (parts[0] === 22) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[22]);
|
|
48
|
+
if (parts[0] === 24) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[24]);
|
|
49
|
+
if (parts[0] === 26) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[26]);
|
|
50
|
+
// Later majors are cut from a fixed main, matching the >=26.12.1 engines tail.
|
|
51
|
+
return parts[0] > 26;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The refusal line when the running Node is vulnerable, else null. */
|
|
55
|
+
export function nodeFloorRefusal(version = process.version) {
|
|
56
|
+
const selected = String(version).startsWith("v") ? String(version).slice(1) : String(version);
|
|
57
|
+
return isPatchedNodeReleaseVersion(selected) ? null : patchedNodeRefusalLine(selected);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function launch(input, nodeVersion = process.version) {
|
|
61
|
+
const floorRefusal = nodeFloorRefusal(nodeVersion);
|
|
62
|
+
if (floorRefusal !== null) return refuse(input.product, floorRefusal);
|
|
16
63
|
const platform = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
17
64
|
if (!input.supported.includes(platform)) return refuse(input.product, `unsupported platform ${platform}; supported platforms: ${input.supported.join(", ")}.`);
|
|
18
65
|
let packageRoot;
|
package/package.json
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": "
|
|
7
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"ceal": "bin/ceal.js",
|
|
11
11
|
"ceal-host": "bin/ceal-host.js"
|
|
12
12
|
},
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"@corca-org/ceal-linux-x64": "1.0.
|
|
15
|
-
"@corca-org/ceal-linux-arm64": "1.0.
|
|
16
|
-
"@corca-org/ceal-darwin-arm64": "1.0.
|
|
17
|
-
"@corca-org/ceal-win32-x64": "1.0.
|
|
14
|
+
"@corca-org/ceal-linux-x64": "1.0.26",
|
|
15
|
+
"@corca-org/ceal-linux-arm64": "1.0.26",
|
|
16
|
+
"@corca-org/ceal-darwin-arm64": "1.0.26",
|
|
17
|
+
"@corca-org/ceal-win32-x64": "1.0.26"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@corca-org/ceal-host": "1.0.
|
|
20
|
+
"@corca-org/ceal-host": "1.0.26"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"bin/launch.js",
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
|
-
"version": "1.0.
|
|
32
|
+
"version": "1.0.26",
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public",
|
|
35
35
|
"provenance": false
|