kritya 0.8.64-beta → 0.8.66-beta
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/dist/commands/doctor.js +50 -14
- package/package.json +4 -1
package/dist/commands/doctor.js
CHANGED
|
@@ -57,24 +57,60 @@ function exists(p) {
|
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The first Node release on each supported line that carries the Brotli
|
|
62
|
+
* decoder fix for CVE-2026-111497. `engines.node` can only state the lowest
|
|
63
|
+
* of these (`>=22.23.4`), and a single `>=` floor cannot express the rest:
|
|
64
|
+
* 24.22.0 and 26.12.0 both compare greater than 22.23.4 but are still
|
|
65
|
+
* affected. Lines with no entry below the newest one here (23, 25) are
|
|
66
|
+
* end-of-life and never received the fix; a line newer than every entry
|
|
67
|
+
* postdates the fix and is accepted.
|
|
68
|
+
*/
|
|
69
|
+
export const PATCHED_NODE_MINIMUMS = {
|
|
70
|
+
22: "22.23.4",
|
|
71
|
+
24: "24.22.1",
|
|
72
|
+
26: "26.12.1",
|
|
73
|
+
};
|
|
74
|
+
function compareVersions(a, b) {
|
|
75
|
+
const pa = a.split(".").map(Number);
|
|
76
|
+
const pb = b.split(".").map(Number);
|
|
77
|
+
for (let i = 0; i < 3; i++) {
|
|
78
|
+
const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
79
|
+
if (diff !== 0)
|
|
80
|
+
return diff;
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Why `actual` is not a patched Node, or null when it is. Exported so the
|
|
86
|
+
* per-line table can be tested without faking the running runtime.
|
|
87
|
+
*/
|
|
88
|
+
export function nodeSecurityProblem(actual) {
|
|
89
|
+
const [major = 0] = actual.split(".").map(Number);
|
|
90
|
+
const lines = Object.keys(PATCHED_NODE_MINIMUMS)
|
|
91
|
+
.map(Number)
|
|
92
|
+
.sort((a, b) => a - b);
|
|
93
|
+
const lowest = PATCHED_NODE_MINIMUMS[lines[0]];
|
|
94
|
+
if (major < lines[0]) {
|
|
95
|
+
return `node ${actual} — this package requires a patched Node (>=${lowest}; 22.23.4 / 24.22.1 / 26.12.1 per line)`;
|
|
96
|
+
}
|
|
97
|
+
const minimum = PATCHED_NODE_MINIMUMS[major];
|
|
98
|
+
if (minimum) {
|
|
99
|
+
return compareVersions(actual, minimum) < 0
|
|
100
|
+
? `node ${actual} — Node ${major}.x requires >=${minimum} for the Brotli decoder fix (CVE-2026-111497)`
|
|
101
|
+
: null;
|
|
102
|
+
}
|
|
103
|
+
if (major < lines[lines.length - 1]) {
|
|
104
|
+
return `node ${actual} — Node ${major}.x is end-of-life and has no release with the Brotli decoder fix (CVE-2026-111497); use 22.23.4 / 24.22.1 / 26.12.1 or later`;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
60
108
|
function runtimeSection() {
|
|
61
109
|
const checks = [];
|
|
62
110
|
const required = pkg.engines?.node;
|
|
63
111
|
const actual = process.versions.node;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
// this package ever uses are `>=` and a bare version. The patch number is
|
|
67
|
-
// compared too, not just major.minor: the floor is a security floor (the
|
|
68
|
-
// Brotli decoder fix in CVE-2026-111497 landed in 22.23.4), so a 22.23.x
|
|
69
|
-
// below that patch is exactly the case this check exists to catch.
|
|
70
|
-
const minimum = required?.replace(/^>=\s*/, "");
|
|
71
|
-
const [reqMajor = 0, reqMinor = 0, reqPatch = 0] = (minimum ?? "").split(".").map(Number);
|
|
72
|
-
const tooOld = Boolean(minimum) &&
|
|
73
|
-
(major < reqMajor ||
|
|
74
|
-
(major === reqMajor && (minor < reqMinor || (minor === reqMinor && patch < reqPatch))));
|
|
75
|
-
checks.push(tooOld
|
|
76
|
-
? fail(`node ${actual} — this package requires >=${minimum}`)
|
|
77
|
-
: ok(`node ${actual}${minimum ? ` (requires >=${minimum})` : ""}`));
|
|
112
|
+
const problem = nodeSecurityProblem(actual);
|
|
113
|
+
checks.push(problem ? fail(problem) : ok(`node ${actual}${required ? ` (requires ${required})` : ""}`));
|
|
78
114
|
checks.push(ok(`${process.platform} ${process.arch}`));
|
|
79
115
|
checks.push(ok(`kritya ${VERSION}`));
|
|
80
116
|
return { title: "Runtime", checks };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kritya",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.66-beta",
|
|
4
4
|
"description": "Kritya — Superintelligence at your command line",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
"typescript-eslint": "^8.71.1"
|
|
95
95
|
},
|
|
96
96
|
"overrides": {
|
|
97
|
+
"@electron/get": {
|
|
98
|
+
"undici": "^7.30.1"
|
|
99
|
+
},
|
|
97
100
|
"argparse": "^2.0.1",
|
|
98
101
|
"brace-expansion": "^5.0.12",
|
|
99
102
|
"fast-uri": "^3.1.8",
|