@corca-org/ceal 1.0.25 → 1.1.0

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.
Files changed (2) hide show
  1. package/bin/launch.js +55 -1
  2. package/package.json +7 -7
package/bin/launch.js CHANGED
@@ -12,7 +12,61 @@ import { fileURLToPath } from "node:url";
12
12
 
13
13
  const launcherRequire = createRequire(import.meta.url);
14
14
 
15
- export function launch(input) {
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]}, and a prerelease (nightly/RC) build is refused because whether it carries the fix is unproven; run a patched release.`;
28
+ }
29
+
30
+ function nodeParts(version) {
31
+ const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z._-]+))?(?:\+[0-9A-Za-z._-]+)?$/u.exec(String(version));
32
+ if (match === null) return null;
33
+ return { numbers: [Number(match[1]), Number(match[2]), Number(match[3])], prerelease: match[4] !== undefined };
34
+ }
35
+
36
+ function partsAtLeast(parts, minimum) {
37
+ const floor = nodeParts(minimum);
38
+ if (floor === null) return false;
39
+ if (parts[1] !== floor.numbers[1]) return parts[1] > floor.numbers[1];
40
+ return parts[2] >= floor.numbers[2];
41
+ }
42
+
43
+ /**
44
+ * Whether a Node version carries the CVE-2026-111497 Brotli fix. This mirrors
45
+ * the one owner in gateway/scripts/runtime-artifact-contract.ts: a stable
46
+ * release at or past the floor, and no semver prerelease at any line, because
47
+ * whether a nightly/RC build cut before the fix merged to main contains it is
48
+ * unknown. Build metadata (`+...`) changes no precedence and stays admissible.
49
+ */
50
+ export function isPatchedNodeReleaseVersion(version) {
51
+ const parsed = nodeParts(version);
52
+ if (parsed === null || parsed.prerelease) return false;
53
+ const parts = parsed.numbers;
54
+ if (parts[0] === 22) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[22]);
55
+ if (parts[0] === 24) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[24]);
56
+ if (parts[0] === 26) return partsAtLeast(parts, PATCHED_NODE_LINE_MINIMUMS[26]);
57
+ // Later majors are cut from a fixed main, matching the >=26.12.1 engines tail.
58
+ return parts[0] > 26;
59
+ }
60
+
61
+ /** The refusal line when the running Node is vulnerable, else null. */
62
+ export function nodeFloorRefusal(version = process.version) {
63
+ const selected = String(version).startsWith("v") ? String(version).slice(1) : String(version);
64
+ return isPatchedNodeReleaseVersion(selected) ? null : patchedNodeRefusalLine(selected);
65
+ }
66
+
67
+ export function launch(input, nodeVersion = process.version) {
68
+ const floorRefusal = nodeFloorRefusal(nodeVersion);
69
+ if (floorRefusal !== null) return refuse(input.product, floorRefusal);
16
70
  const platform = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
17
71
  if (!input.supported.includes(platform)) return refuse(input.product, `unsupported platform ${platform}; supported platforms: ${input.supported.join(", ")}.`);
18
72
  let packageRoot;
package/package.json CHANGED
@@ -4,20 +4,20 @@
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
7
- "node": ">=22.0.0"
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.25",
15
- "@corca-org/ceal-linux-arm64": "1.0.25",
16
- "@corca-org/ceal-darwin-arm64": "1.0.25",
17
- "@corca-org/ceal-win32-x64": "1.0.25"
14
+ "@corca-org/ceal-linux-x64": "1.1.0",
15
+ "@corca-org/ceal-linux-arm64": "1.1.0",
16
+ "@corca-org/ceal-darwin-arm64": "1.1.0",
17
+ "@corca-org/ceal-win32-x64": "1.1.0"
18
18
  },
19
19
  "dependencies": {
20
- "@corca-org/ceal-host": "1.0.25"
20
+ "@corca-org/ceal-host": "1.1.0"
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.25",
32
+ "version": "1.1.0",
33
33
  "publishConfig": {
34
34
  "access": "public",
35
35
  "provenance": false