Skip to content

Commit 13ac9e3

Browse files
committed
fix: remove vulnerable runtime dependency paths
1 parent 557569d commit 13ac9e3

7 files changed

Lines changed: 117 additions & 67 deletions

File tree

‎bun.lock‎

Lines changed: 57 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/cli/package.json‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"gen:agent-dirs": "tsx scripts/sync-agent-dirs.ts"
3030
},
3131
"dependencies": {
32-
"@hono/node-server": "^1.8.0",
32+
"@hono/node-server": "^2.0.5",
3333
"@puppeteer/browsers": "^3.0.6",
34-
"adm-zip": "^0.5.16",
34+
"adm-zip": "^0.6.0",
3535
"citty": "^0.2.1",
3636
"compare-versions": "^6.1.1",
3737
"debug": "^4.4.0",
@@ -40,12 +40,12 @@
4040
"giget": "^3.2.0",
4141
"hono": "^4.0.0",
4242
"ignore": "^5.3.2",
43-
"onnxruntime-node": "1.23.2",
43+
"onnxruntime-node": "1.21.1",
4444
"open": "^10.0.0",
4545
"postcss": "^8.5.8",
4646
"prettier": "^3.8.1",
4747
"puppeteer-core": "^25.2.1",
48-
"sharp": "^0.34.5"
48+
"sharp": "^0.35.0"
4949
},
5050
"devDependencies": {
5151
"@clack/prompts": "^1.1.0",
@@ -58,7 +58,6 @@
5858
"@hyperframes/producer": "workspace:*",
5959
"@hyperframes/studio": "workspace:*",
6060
"@hyperframes/studio-server": "workspace:*",
61-
"@types/adm-zip": "^0.5.7",
6261
"@types/fontkit": "^2.0.9",
6362
"@types/mime-types": "^3.0.1",
6463
"@types/node": "^25.0.10",

‎packages/cli/src/background-removal/dependency-compat.test.ts‎

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,64 @@ import { describe, expect, it } from "vitest";
77
const require = createRequire(import.meta.url);
88

99
describe("background-removal native dependency compatibility", () => {
10-
it("pins onnxruntime-node to the last release with an Intel macOS binary", () => {
10+
it("keeps CLI native dependencies above their patched security floors", () => {
1111
const packagePath = fileURLToPath(new URL("../../package.json", import.meta.url));
1212
const packageJson = JSON.parse(readFileSync(packagePath, "utf8")) as {
1313
dependencies?: Record<string, string>;
1414
};
1515

16-
expect(packageJson.dependencies?.["onnxruntime-node"]).toBe("1.23.2");
16+
expect(packageJson.dependencies).toMatchObject({
17+
"adm-zip": "^0.6.0",
18+
sharp: "^0.35.0",
19+
});
20+
});
21+
22+
it("keeps every Node server consumer above the patched security floor", () => {
23+
for (const manifest of [
24+
"../../package.json",
25+
"../../../engine/package.json",
26+
"../../../producer/package.json",
27+
"../../../gcp-cloud-run/package.json",
28+
]) {
29+
const packageJson = JSON.parse(
30+
readFileSync(fileURLToPath(new URL(manifest, import.meta.url)), "utf8"),
31+
) as {
32+
dependencies?: Record<string, string>;
33+
};
34+
expect(packageJson.dependencies?.["@hono/node-server"], manifest).toBe("^2.0.5");
35+
}
36+
});
37+
38+
it("pins the newest clean-audit ONNX release that retains Intel macOS", () => {
39+
const packagePath = fileURLToPath(new URL("../../package.json", import.meta.url));
40+
const packageJson = JSON.parse(readFileSync(packagePath, "utf8")) as {
41+
dependencies?: Record<string, string>;
42+
};
43+
44+
// 1.22+ pulls vulnerable adm-zip <0.6.0, while later releases also drop
45+
// the Intel macOS binary. Return to a newer ONNX release once it satisfies
46+
// both the clean dependency graph and the six-platform binary contract.
47+
expect(packageJson.dependencies?.["onnxruntime-node"]).toBe("1.21.1");
1748

1849
const bindingEntry = require.resolve("onnxruntime-node");
1950
const packageRoot = join(dirname(bindingEntry), "..");
20-
expect(existsSync(join(packageRoot, "bin/napi-v6/darwin/x64/onnxruntime_binding.node"))).toBe(
21-
true,
22-
);
51+
const onnxPackageJson = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8")) as {
52+
dependencies?: Record<string, string>;
53+
};
54+
expect(onnxPackageJson.dependencies).not.toHaveProperty("adm-zip");
55+
56+
for (const [platform, arch] of [
57+
["darwin", "arm64"],
58+
["darwin", "x64"],
59+
["linux", "arm64"],
60+
["linux", "x64"],
61+
["win32", "arm64"],
62+
["win32", "x64"],
63+
] as const) {
64+
expect(
65+
existsSync(join(packageRoot, "bin/napi-v3", platform, arch, "onnxruntime_binding.node")),
66+
`${platform}/${arch} binding should be published`,
67+
).toBe(true);
68+
}
2369
});
2470
});

‎packages/cli/src/capture/contactSheet.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Saves 50-65% tokens vs. AI agents reading images individually.
66
*/
77

8-
import sharp from "sharp";
8+
import sharp, { type OverlayOptions } from "sharp";
99
import { readdirSync, readFileSync, writeFileSync, unlinkSync, existsSync } from "node:fs";
1010
import { join, extname, basename, dirname } from "node:path";
1111

@@ -57,7 +57,7 @@ export async function createContactSheet(
5757
const totalW = cols * cellW + (cols + 1) * padding;
5858
const totalH = rows * (cellH + labelH) + (rows + 1) * padding;
5959

60-
const overlays: sharp.OverlayOptions[] = [];
60+
const overlays: OverlayOptions[] = [];
6161

6262
for (let i = 0; i < files.length; i++) {
6363
const col = i % cols;

‎packages/engine/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"typecheck": "tsc --noEmit"
5959
},
6060
"dependencies": {
61-
"@hono/node-server": "^1.13.0",
61+
"@hono/node-server": "^2.0.5",
6262
"@hyperframes/core": "workspace:^",
6363
"@hyperframes/parsers": "workspace:^",
6464
"hono": "^4.6.0",

‎packages/gcp-cloud-run/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"dependencies": {
7171
"@google-cloud/storage": "^7.14.0",
7272
"@google-cloud/workflows": "^4.2.0",
73-
"@hono/node-server": "^1.13.0",
73+
"@hono/node-server": "^2.0.5",
7474
"@hyperframes/producer": "workspace:^",
7575
"hono": "^4.6.0",
7676
"puppeteer-core": "^25.2.1",

‎packages/producer/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"@fontsource/oswald": "^5.2.8",
8888
"@fontsource/outfit": "^5.2.8",
8989
"@fontsource/space-mono": "^5.2.9",
90-
"@hono/node-server": "^1.13.0",
90+
"@hono/node-server": "^2.0.5",
9191
"@hyperframes/core": "workspace:^",
9292
"@hyperframes/engine": "workspace:^",
9393
"@hyperframes/lint": "workspace:^",

0 commit comments

Comments
 (0)