From 22f55a713ae5950a998ec9a73dc7cec542dc402c Mon Sep 17 00:00:00 2001 From: Oll4 Open Source Date: Fri, 24 Jul 2026 15:23:26 +0300 Subject: [PATCH 1/6] fix: verify compact OCI release attestations --- .../published-container-verification.test.mjs | 116 ++++++++++++++---- scripts/verify-published-containers.mjs | 80 ++++++++---- 2 files changed, 149 insertions(+), 47 deletions(-) diff --git a/scripts/tests/published-container-verification.test.mjs b/scripts/tests/published-container-verification.test.mjs index 3d12bb028..8020a1964 100644 --- a/scripts/tests/published-container-verification.test.mjs +++ b/scripts/tests/published-container-verification.test.mjs @@ -1,17 +1,51 @@ import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; -import { resolve } from "node:path"; import test from "node:test"; -import { evaluatePublishedContainer } from "../verify-published-containers.mjs"; - -const verifierPath = resolve(import.meta.dirname, "../verify-published-containers.mjs"); +import { + evaluatePublishedContainer, + loadPublishedContainerEvidence +} from "../verify-published-containers.mjs"; const manifest = { manifests: [ - { platform: { os: "linux", architecture: "amd64" } }, - { platform: { os: "unknown", architecture: "unknown" } }, - { platform: { os: "linux", architecture: "arm64" } }, - { platform: { os: "unknown", architecture: "unknown" } } + { + digest: "sha256:amd64", + platform: { os: "linux", architecture: "amd64" } + }, + { + digest: "sha256:arm64", + platform: { os: "linux", architecture: "arm64" } + }, + { + digest: "sha256:amd64-attestation", + annotations: { + "vnd.docker.reference.digest": "sha256:amd64", + "vnd.docker.reference.type": "attestation-manifest" + }, + platform: { os: "unknown", architecture: "unknown" } + }, + { + digest: "sha256:arm64-attestation", + annotations: { + "vnd.docker.reference.digest": "sha256:arm64", + "vnd.docker.reference.type": "attestation-manifest" + }, + platform: { os: "unknown", architecture: "unknown" } + } + ] +}; + +const attestationManifest = { + layers: [ + { + annotations: { + "in-toto.io/predicate-type": "https://spdx.dev/Document" + } + }, + { + annotations: { + "in-toto.io/predicate-type": "https://slsa.dev/provenance/v1" + } + } ] }; @@ -20,8 +54,16 @@ test("published container verification requires both platforms and attestations" evaluatePublishedContainer({ image: "ghcr.io/oll4com/spaceapp-core:0.1.4", manifest, - sbom: { SPDXID: "SPDXRef-DOCUMENT" }, - provenance: { buildType: "https://mobyproject.org/buildkit@v1" } + attestations: [ + { + descriptor: manifest.manifests[2], + manifest: attestationManifest + }, + { + descriptor: manifest.manifests[3], + manifest: attestationManifest + } + ] }), { ok: true, blockers: [] } ); @@ -30,22 +72,52 @@ test("published container verification requires both platforms and attestations" test("published container verification reports missing architecture and evidence", () => { const result = evaluatePublishedContainer({ image: "ghcr.io/oll4com/spaceapp-core:0.1.4", - manifest: { manifests: manifest.manifests.slice(0, 2) }, - sbom: null, - provenance: null + manifest: { manifests: [manifest.manifests[0], manifest.manifests[2]] }, + attestations: [ + { + descriptor: manifest.manifests[2], + manifest: { layers: [] } + } + ] }); assert.deepEqual(result.blockers, [ - "ghcr.io/oll4com/spaceapp-core:0.1.4 is missing linux/arm64.", - "ghcr.io/oll4com/spaceapp-core:0.1.4 does not expose two platform attestations.", - "ghcr.io/oll4com/spaceapp-core:0.1.4 does not expose an SBOM.", - "ghcr.io/oll4com/spaceapp-core:0.1.4 does not expose provenance." + "ghcr.io/oll4com/spaceapp-core:0.1.4 does not expose an SBOM for linux/amd64.", + "ghcr.io/oll4com/spaceapp-core:0.1.4 does not expose provenance for linux/amd64.", + "ghcr.io/oll4com/spaceapp-core:0.1.4 is missing linux/arm64." ]); }); -test("published container verification reads SLSA from Buildx provenance", async () => { - const verifier = await readFile(verifierPath, "utf8"); +test("published container verification reads compact attestation manifests instead of full SBOM documents", () => { + const calls = []; + const inspectRaw = (reference) => { + calls.push(reference); + if (reference.endsWith(":0.1.4")) return manifest; + return attestationManifest; + }; - assert.match(verifier, /\["--format", "\{\{json \.Provenance\.SLSA\}\}"\]/); - assert.doesNotMatch(verifier, /\["--format", "\{\{json \.SLSA\}\}"\]/); + assert.deepEqual( + loadPublishedContainerEvidence( + "ghcr.io/oll4com/spaceapp-core:0.1.4", + inspectRaw + ), + { + manifest, + attestations: [ + { + descriptor: manifest.manifests[2], + manifest: attestationManifest + }, + { + descriptor: manifest.manifests[3], + manifest: attestationManifest + } + ] + } + ); + assert.deepEqual(calls, [ + "ghcr.io/oll4com/spaceapp-core:0.1.4", + "ghcr.io/oll4com/spaceapp-core@sha256:amd64-attestation", + "ghcr.io/oll4com/spaceapp-core@sha256:arm64-attestation" + ]); }); diff --git a/scripts/verify-published-containers.mjs b/scripts/verify-published-containers.mjs index 57e4c350f..f02de7a59 100644 --- a/scripts/verify-published-containers.mjs +++ b/scripts/verify-published-containers.mjs @@ -6,41 +6,51 @@ import { pathToFileURL } from "node:url"; const targets = ["core", "cli", "browser"]; const stableVersionPattern = /^\d+\.\d+\.\d+$/; -export function evaluatePublishedContainer({ image, manifest, sbom, provenance }) { +const sbomPredicate = "https://spdx.dev/Document"; +const provenancePredicate = "https://slsa.dev/provenance/v1"; + +export function evaluatePublishedContainer({ image, manifest, attestations }) { const blockers = []; const manifests = Array.isArray(manifest?.manifests) ? manifest.manifests : []; for (const architecture of ["amd64", "arm64"]) { - const present = manifests.some( + const platformManifest = manifests.find( (entry) => entry?.platform?.os === "linux" && entry?.platform?.architecture === architecture ); - if (!present) blockers.push(`${image} is missing linux/${architecture}.`); - } - const attestationCount = manifests.filter( - (entry) => - entry?.platform?.os === "unknown" && - entry?.platform?.architecture === "unknown" - ).length; - if (attestationCount < 2) { - blockers.push(`${image} does not expose two platform attestations.`); - } - if (!sbom || (typeof sbom === "object" && Object.keys(sbom).length === 0)) { - blockers.push(`${image} does not expose an SBOM.`); - } - if ( - !provenance || - (typeof provenance === "object" && Object.keys(provenance).length === 0) - ) { - blockers.push(`${image} does not expose provenance.`); + if (!platformManifest) { + blockers.push(`${image} is missing linux/${architecture}.`); + continue; + } + const attestation = (Array.isArray(attestations) ? attestations : []).find( + (entry) => + entry?.descriptor?.annotations?.["vnd.docker.reference.type"] === + "attestation-manifest" && + entry?.descriptor?.annotations?.["vnd.docker.reference.digest"] === + platformManifest.digest + ); + const predicates = new Set( + (Array.isArray(attestation?.manifest?.layers) + ? attestation.manifest.layers + : [] + ) + .map((layer) => layer?.annotations?.["in-toto.io/predicate-type"]) + .filter((value) => typeof value === "string") + ); + if (!predicates.has(sbomPredicate)) { + blockers.push(`${image} does not expose an SBOM for linux/${architecture}.`); + } + if (!predicates.has(provenancePredicate)) { + blockers.push(`${image} does not expose provenance for linux/${architecture}.`); + } } return { ok: blockers.length === 0, blockers }; } -function inspect(image, args) { +function inspectRaw(image) { const result = spawnSync( "docker", - ["buildx", "imagetools", "inspect", image, ...args], + ["buildx", "imagetools", "inspect", image, "--raw"], { encoding: "utf8", timeout: 60_000, @@ -57,6 +67,28 @@ function inspect(image, args) { } } +export function loadPublishedContainerEvidence(image, inspect = inspectRaw) { + const manifest = inspect(image); + const repository = image.slice(0, image.lastIndexOf(":")); + const attestationDescriptors = ( + Array.isArray(manifest?.manifests) ? manifest.manifests : [] + ).filter( + (entry) => + entry?.platform?.os === "unknown" && + entry?.platform?.architecture === "unknown" && + entry?.annotations?.["vnd.docker.reference.type"] === + "attestation-manifest" && + typeof entry?.digest === "string" + ); + return { + manifest, + attestations: attestationDescriptors.map((descriptor) => ({ + descriptor, + manifest: inspect(`${repository}@${descriptor.digest}`) + })) + }; +} + function parseArgs(argv) { if (argv.length !== 2 || argv[0] !== "--version" || !stableVersionPattern.test(argv[1])) { throw new Error( @@ -73,9 +105,7 @@ export function runCli(argv) { const image = `ghcr.io/oll4com/spaceapp-${target}:${version}`; const result = evaluatePublishedContainer({ image, - manifest: inspect(image, ["--raw"]), - sbom: inspect(image, ["--format", "{{json .SBOM}}"]), - provenance: inspect(image, ["--format", "{{json .Provenance.SLSA}}"]) + ...loadPublishedContainerEvidence(image) }); blockers.push(...result.blockers); } From e8b6dcf462f2a153d989bd59e0476b9e9f2acbd6 Mon Sep 17 00:00:00 2001 From: Oll4 Open Source Date: Fri, 24 Jul 2026 15:27:25 +0300 Subject: [PATCH 2/6] fix: remove CodeQL command and code injection paths --- apps/api/src/browser-sessions.ts | 73 ++++++++++++++++--- .../tests/browser-capture-security.test.ts | 58 +++++++++++++++ apps/web/server-routing.mjs | 12 +++ apps/web/server.mjs | 9 +-- apps/web/tests/server-routing.test.mjs | 23 ++++++ packages/run-spaceapp/src/cli.mjs | 22 ++++++ packages/run-spaceapp/src/prerequisites.mjs | 34 +++++++-- packages/run-spaceapp/tests/cli.test.mjs | 19 ++++- .../run-spaceapp/tests/prerequisites.test.mjs | 20 +++-- 9 files changed, 243 insertions(+), 27 deletions(-) create mode 100644 apps/api/tests/browser-capture-security.test.ts create mode 100644 apps/web/server-routing.mjs create mode 100644 apps/web/tests/server-routing.test.mjs diff --git a/apps/api/src/browser-sessions.ts b/apps/api/src/browser-sessions.ts index c5682cbc4..63940a28b 100644 --- a/apps/api/src/browser-sessions.ts +++ b/apps/api/src/browser-sessions.ts @@ -1157,6 +1157,63 @@ function readRuntimeValue(result: { result?: { value?: T } }): T | null { return result.result && "value" in result.result ? (result.result.value ?? null) : null; } +interface ElementScreenshotClip { + x: number; + y: number; + width: number; + height: number; + scale: number; +} + +interface CdpCommandSender { + send( + method: string, + params?: Record, + sessionId?: string + ): Promise; +} + +export async function resolveElementScreenshotClip( + client: CdpCommandSender, + cdpSessionId: string, + selector: string +): Promise { + const documentResult = await client.send( + "DOM.getDocument", + { depth: 0, pierce: true }, + cdpSessionId + ) as { root?: { nodeId?: number } }; + const rootNodeId = documentResult.root?.nodeId; + if (!Number.isInteger(rootNodeId) || !rootNodeId || rootNodeId <= 0) return null; + + const queryResult = await client.send( + "DOM.querySelector", + { nodeId: rootNodeId, selector }, + cdpSessionId + ) as { nodeId?: number }; + if (!Number.isInteger(queryResult.nodeId) || !queryResult.nodeId || queryResult.nodeId <= 0) { + return null; + } + + const boxResult = await client.send( + "DOM.getBoxModel", + { nodeId: queryResult.nodeId }, + cdpSessionId + ) as { model?: { border?: number[] } }; + const border = boxResult.model?.border; + if (!Array.isArray(border) || border.length < 8 || border.some((value) => !Number.isFinite(value))) { + return null; + } + const xCoordinates = border.filter((_value, index) => index % 2 === 0); + const yCoordinates = border.filter((_value, index) => index % 2 === 1); + const x = Math.min(...xCoordinates); + const y = Math.min(...yCoordinates); + const width = Math.max(...xCoordinates) - x; + const height = Math.max(...yCoordinates) - y; + if (width <= 0 || height <= 0) return null; + return { x, y, width, height, scale: 1 }; +} + export function createBrowserSessionManager(options: { store: SpaceStore; config: SpaceApiConfig }): BrowserSessionManager { const { store, config } = options; const runtimes = new Map(); @@ -1809,17 +1866,13 @@ export function createBrowserSessionManager(options: { store: SpaceStore; config const size = metrics.contentSize; if (size?.width && size.height) clip = { x: size.x ?? 0, y: size.y ?? 0, width: size.width, height: size.height, scale: 1 }; } else if (job.options.target === "ELEMENT" && job.options.selector) { - const result = await runtime.client.send<{ result?: { value?: { x: number; y: number; width: number; height: number } | null } }>( - "Runtime.evaluate", - { - expression: `(() => { const element = document.querySelector(${JSON.stringify(job.options.selector)}); if (!element) return null; const r = element.getBoundingClientRect(); return { x: r.x + scrollX, y: r.y + scrollY, width: r.width, height: r.height }; })()`, - returnByValue: true - }, - runtime.cdpSessionId + const value = await resolveElementScreenshotClip( + runtime.client, + runtime.cdpSessionId, + job.options.selector ); - const value = readRuntimeValue(result); - if (!value || value.width <= 0 || value.height <= 0) throw new SpaceNotFoundError(`Browser element ${job.options.selector} was not found.`); - clip = { ...value, scale: 1 }; + if (!value) throw new SpaceNotFoundError(`Browser element ${job.options.selector} was not found.`); + clip = value; } const screenshot = await runtime.client.send<{ data: string }>( "Page.captureScreenshot", diff --git a/apps/api/tests/browser-capture-security.test.ts b/apps/api/tests/browser-capture-security.test.ts new file mode 100644 index 000000000..379a7b7a2 --- /dev/null +++ b/apps/api/tests/browser-capture-security.test.ts @@ -0,0 +1,58 @@ +import { describe, expect, it, vi } from "vitest"; +import { resolveElementScreenshotClip } from "../src/browser-sessions.js"; + +describe("resolveElementScreenshotClip", () => { + it("passes selectors as CDP data and never constructs executable JavaScript", async () => { + const send = vi.fn(async (method: string, params: Record) => { + if (method === "DOM.getDocument") return { root: { nodeId: 1 } }; + if (method === "DOM.querySelector") { + expect(params).toEqual({ + nodeId: 1, + selector: `button[data-label="'); globalThis.compromised = true; //"]` + }); + return { nodeId: 42 }; + } + if (method === "DOM.getBoxModel") { + expect(params).toEqual({ nodeId: 42 }); + return { + model: { + border: [10, 20, 110, 20, 110, 70, 10, 70] + } + }; + } + throw new Error(`Unexpected CDP method ${method}`); + }); + + await expect( + resolveElementScreenshotClip( + { send }, + "cdp-session", + `button[data-label="'); globalThis.compromised = true; //"]` + ) + ).resolves.toEqual({ + x: 10, + y: 20, + width: 100, + height: 50, + scale: 1 + }); + expect(send.mock.calls.map(([method]) => method)).toEqual([ + "DOM.getDocument", + "DOM.querySelector", + "DOM.getBoxModel" + ]); + expect(send.mock.calls.some(([method]) => method === "Runtime.evaluate")).toBe(false); + }); + + it("returns null when the selector does not match a node", async () => { + const send = vi.fn(async (method: string) => { + if (method === "DOM.getDocument") return { root: { nodeId: 1 } }; + if (method === "DOM.querySelector") return { nodeId: 0 }; + throw new Error(`Unexpected CDP method ${method}`); + }); + + await expect( + resolveElementScreenshotClip({ send }, "cdp-session", "#missing") + ).resolves.toBeNull(); + }); +}); diff --git a/apps/web/server-routing.mjs b/apps/web/server-routing.mjs new file mode 100644 index 000000000..201aa7400 --- /dev/null +++ b/apps/web/server-routing.mjs @@ -0,0 +1,12 @@ +const readOnlyMethods = new Set(["GET", "HEAD"]); + +export function resolveLegacyAppRedirect(rawUrl, method) { + const requestUrl = new URL(rawUrl ?? "/", "http://space.local"); + if ( + (requestUrl.pathname === "/app" || requestUrl.pathname === "/app/") && + readOnlyMethods.has(method) + ) { + return "/"; + } + return null; +} diff --git a/apps/web/server.mjs b/apps/web/server.mjs index 0ea9c0389..18c0de39e 100644 --- a/apps/web/server.mjs +++ b/apps/web/server.mjs @@ -4,6 +4,7 @@ import http from "node:http"; import net from "node:net"; import path from "node:path"; import { fileURLToPath } from "node:url"; +import { resolveLegacyAppRedirect } from "./server-routing.mjs"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const host = process.env.SPACE_WEB_HOST ?? "0.0.0.0"; @@ -404,13 +405,11 @@ function serveFile(request, response, filePath) { const server = http.createServer((request, response) => { const requestUrl = new URL(request.url ?? "/", "http://space.local"); - if ( - (requestUrl.pathname === "/app" || requestUrl.pathname === "/app/") && - (request.method === "GET" || request.method === "HEAD") - ) { + const legacyAppRedirect = resolveLegacyAppRedirect(request.url, request.method); + if (legacyAppRedirect) { response.writeHead(308, { "cache-control": "no-store", - location: `/${requestUrl.search}` + location: legacyAppRedirect }); response.end(); return; diff --git a/apps/web/tests/server-routing.test.mjs b/apps/web/tests/server-routing.test.mjs new file mode 100644 index 000000000..590fc4bc6 --- /dev/null +++ b/apps/web/tests/server-routing.test.mjs @@ -0,0 +1,23 @@ +import { describe, expect, it } from "vitest"; +import { resolveLegacyAppRedirect } from "../server-routing.mjs"; + +describe("resolveLegacyAppRedirect", () => { + it("redirects legacy app GET and HEAD requests to a fixed same-origin path", () => { + expect(resolveLegacyAppRedirect("/app", "GET")).toBe("/"); + expect(resolveLegacyAppRedirect("/app/", "HEAD")).toBe("/"); + }); + + it("does not reflect attacker-controlled query data into the Location header", () => { + expect( + resolveLegacyAppRedirect( + "/app?next=https://attacker.example/%0d%0aX-Test:injected", + "GET" + ) + ).toBe("/"); + }); + + it("does not redirect unrelated paths or mutation requests", () => { + expect(resolveLegacyAppRedirect("/", "GET")).toBeNull(); + expect(resolveLegacyAppRedirect("/app", "POST")).toBeNull(); + }); +}); diff --git a/packages/run-spaceapp/src/cli.mjs b/packages/run-spaceapp/src/cli.mjs index 651cab399..e86c72afc 100644 --- a/packages/run-spaceapp/src/cli.mjs +++ b/packages/run-spaceapp/src/cli.mjs @@ -22,6 +22,20 @@ import { } from "./index.mjs"; import { ensureDockerAvailable } from "./prerequisites.mjs"; +const trustedCommands = new Set([ + "cmd", + "codesign", + "docker", + "hdiutil", + "open", + "powershell.exe", + "sg", + "spctl", + "sudo", + "wsl.exe", + "xdg-open" +]); + export async function run(argv, { env = process.env, platform = process.platform, @@ -508,6 +522,14 @@ export async function readSecret(stdin, stdout, prompt, { mask = true } = {}) { export function executeCommand(spec, { stdin, stdout, stderr, input } = {}) { return new Promise((resolve, reject) => { + if (!spec || typeof spec !== "object" || !trustedCommands.has(spec.command)) { + reject(new Error("SpaceApp refused to execute an untrusted command.")); + return; + } + if (!Array.isArray(spec.args) || spec.args.some((argument) => typeof argument !== "string")) { + reject(new Error("SpaceApp command arguments must be strings.")); + return; + } const child = spawn(spec.command, spec.args, { shell: false, stdio: [input === undefined ? (stdin || "inherit") : "pipe", stdout || "ignore", stderr || "ignore"] diff --git a/packages/run-spaceapp/src/prerequisites.mjs b/packages/run-spaceapp/src/prerequisites.mjs index ac6942112..da2ac51a3 100644 --- a/packages/run-spaceapp/src/prerequisites.mjs +++ b/packages/run-spaceapp/src/prerequisites.mjs @@ -177,10 +177,24 @@ async function ensureWindowsDocker({ stderr.write("The Docker Desktop installer signature is not valid. Installation was stopped.\n"); return { code: 1, reexecuted: false }; } - const installCode = await execute({ - command: installer, - args: ["install", "--user", "--quiet", "--accept-license"] - }, { stdin, stdout, stderr }); + const installCode = await execute( + { + command: "powershell.exe", + args: [ + "-NoLogo", + "-NoProfile", + "-NonInteractive", + "-Command", + "$process = Start-Process -FilePath $args[0] -ArgumentList $args[1..($args.Count - 1)] -Wait -PassThru; exit $process.ExitCode", + installer, + "install", + "--user", + "--quiet", + "--accept-license" + ] + }, + { stdin, stdout, stderr } + ); if (installCode !== 0) { stderr.write("Docker Desktop installation failed before SpaceApp downloaded any images.\n"); return { code: installCode, reexecuted: false }; @@ -201,7 +215,17 @@ async function ensureWindowsDocker({ if (cliDirectory) { prependPath(env, cliDirectory); } - const launchCode = await launch({ command: application, args: [] }); + const launchCode = await launch({ + command: "powershell.exe", + args: [ + "-NoLogo", + "-NoProfile", + "-NonInteractive", + "-Command", + "Start-Process -FilePath $args[0]", + application + ] + }); if (launchCode !== 0) { stderr.write("Docker Desktop is installed, but SpaceApp could not start it.\n"); return { code: launchCode, reexecuted: false }; diff --git a/packages/run-spaceapp/tests/cli.test.mjs b/packages/run-spaceapp/tests/cli.test.mjs index 202ff27e6..2d3509add 100644 --- a/packages/run-spaceapp/tests/cli.test.mjs +++ b/packages/run-spaceapp/tests/cli.test.mjs @@ -4,7 +4,7 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { Readable, Writable } from "node:stream"; import test from "node:test"; -import { run } from "../src/cli.mjs"; +import { executeCommand, run } from "../src/cli.mjs"; function capture() { let value = ""; @@ -23,6 +23,23 @@ const eightGigabyteClassLinuxGuest = Object.freeze({ freeDiskBytes: 15 * 1024 ** 3 }); +test("the process launcher rejects executables outside the fixed command allowlist", async () => { + await assert.rejects( + executeCommand({ + command: "/tmp/untrusted-spaceapp-executable", + args: [] + }), + /SpaceApp refused to execute an untrusted command/ + ); + await assert.rejects( + executeCommand({ + command: "docker", + args: ["info", 123] + }), + /SpaceApp command arguments must be strings/ + ); +}); + test("init emits a one-time setup token without placing it in config", async () => { const root = await mkdtemp(join(tmpdir(), "spaceapp-cli-init-")); const stdout = capture(); diff --git a/packages/run-spaceapp/tests/prerequisites.test.mjs b/packages/run-spaceapp/tests/prerequisites.test.mjs index 430fba6bc..b4f2586a7 100644 --- a/packages/run-spaceapp/tests/prerequisites.test.mjs +++ b/packages/run-spaceapp/tests/prerequisites.test.mjs @@ -46,9 +46,8 @@ test("Windows enables WSL2, installs signed Docker Desktop, and continues in one wslChecks += 1; return wslChecks === 1 ? 1 : 0; } - if (spec.command === "powershell.exe") return 0; - if (spec.command.endsWith("Docker Desktop Installer.exe")) { - installed = true; + if (spec.command === "powershell.exe") { + if (spec.args.includes("--accept-license")) installed = true; return 0; } return 0; @@ -79,14 +78,23 @@ test("Windows enables WSL2, installs signed Docker Desktop, and continues in one spec.args.join(" ").includes("-Verb RunAs") )); assert.ok(calls.some((spec) => - spec.command.endsWith("Docker Desktop Installer.exe") && + spec.command === "powershell.exe" && + spec.args.join(" ").includes("Start-Process") && + spec.args.some((argument) => argument.endsWith("Docker Desktop Installer.exe")) && spec.args.includes("--user") && spec.args.includes("--quiet") && spec.args.includes("--accept-license") )); assert.deepEqual(launches, [{ - command: "C:\\Users\\Admin\\AppData\\Local\\Programs\\DockerDesktop\\Docker Desktop.exe", - args: [] + command: "powershell.exe", + args: [ + "-NoLogo", + "-NoProfile", + "-NonInteractive", + "-Command", + "Start-Process -FilePath $args[0]", + "C:\\Users\\Admin\\AppData\\Local\\Programs\\DockerDesktop\\Docker Desktop.exe" + ] }]); assert.match(stdout.value(), /Docker Desktop is required/i); assert.match(stdout.value(), /Docker Desktop is ready/i); From 607b6d82ce4fdec5204d9b9f089ee4c1ec51ad31 Mon Sep 17 00:00:00 2001 From: Oll4 Open Source Date: Fri, 24 Jul 2026 15:28:27 +0300 Subject: [PATCH 3/6] test: prove global API rate-limit ordering --- apps/api/tests/route-rate-limits.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/api/tests/route-rate-limits.test.ts b/apps/api/tests/route-rate-limits.test.ts index e63b2b0f4..ad3ca0bd2 100644 --- a/apps/api/tests/route-rate-limits.test.ts +++ b/apps/api/tests/route-rate-limits.test.ts @@ -46,6 +46,26 @@ it("declares an explicit CodeQL-visible rate limit on every Fastify route", asyn expect(missing, `Routes without explicit rate limits:\n${missing.join("\n")}`).toEqual([]); }); +it("registers the global limiter before request authentication and lifecycle hooks", async () => { + const appPath = fileURLToPath(new URL("../src/app.ts", import.meta.url)); + const sourceText = await readFile(appPath, "utf8"); + const limiterRegistration = sourceText.indexOf("await app.register(rateLimit"); + + expect(limiterRegistration).toBeGreaterThan(-1); + for (const hook of [ + 'app.addHook("onRequest"', + 'app.addHook("onResponse"', + 'app.addHook("onClose"', + 'app.addHook("onReady"', + 'app.addHook("preHandler"' + ]) { + expect( + sourceText.indexOf(hook), + `${hook} must remain behind the registered global limiter` + ).toBeGreaterThan(limiterRegistration); + } +}); + it("enforces the configured default limit on routes without stricter overrides", async () => { const app = await createApp({ config: { From afc575173eabdfc53ff671388b1571bb37f2494b Mon Sep 17 00:00:00 2001 From: Oll4 Open Source Date: Fri, 24 Jul 2026 15:37:20 +0300 Subject: [PATCH 4/6] build: update compatible public dependencies --- .github/workflows/ci.yml | 2 +- .github/workflows/containers.yml | 4 +- .github/workflows/platform-matrix.yml | 2 +- .github/workflows/release.yml | 24 +- .github/workflows/security.yml | 18 +- apps/web/package.json | 8 +- apps/web/src/App.tsx | 4 +- package-lock.json | 847 +++++++++++++++++--------- package.json | 4 +- tsconfig.base.json | 1 - 10 files changed, 584 insertions(+), 330 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fe74b07e..7c316ed5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 40 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 906f9e0af..5da1c181d 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 50 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 with: diff --git a/.github/workflows/platform-matrix.yml b/.github/workflows/platform-matrix.yml index e019b8bc3..2d4f9aa48 100644 --- a/.github/workflows/platform-matrix.yml +++ b/.github/workflows/platform-matrix.yml @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 20 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc9a5b15d..24b588c6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: if: github.ref == 'refs/heads/main' run: echo "Release source is main." - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 50 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: @@ -116,7 +116,7 @@ jobs: sha256sum "run-spaceapp-${{ inputs.version }}.tgz" > "run-spaceapp-${{ inputs.version }}.tgz.sha256" - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: public-release-source-candidate-${{ inputs.version }} path: ${{ runner.temp }}/release-artifacts/ @@ -138,7 +138,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 65 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Create sanitized container context run: >- @@ -146,7 +146,7 @@ jobs: --output "$RUNNER_TEMP/spaceapp-public-export" - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 with: @@ -197,7 +197,7 @@ jobs: - name: Upload full candidate image report if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: trivy-full-${{ matrix.target }}-${{ matrix.arch }} path: trivy-full-${{ matrix.target }}-${{ matrix.arch }}.json @@ -216,9 +216,9 @@ jobs: packages: write id-token: write steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: @@ -261,7 +261,7 @@ jobs: -xzf "$RUNNER_TEMP/release-artifacts/spaceapp-public-export-${{ inputs.version }}.tar.gz" - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: @@ -293,9 +293,9 @@ jobs: packages: write id-token: write steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: @@ -319,7 +319,7 @@ jobs: packages: write id-token: write steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index b2a799eba..51b505360 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 35 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 @@ -83,7 +83,7 @@ jobs: - name: Upload full filesystem report if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: trivy-full-filesystem path: trivy-full-filesystem.json @@ -96,7 +96,7 @@ jobs: format: spdx-json output-file: spaceapp-source.spdx.json - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: source-sbom path: spaceapp-source.spdx.json @@ -107,8 +107,8 @@ jobs: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 with: fail-on-severity: high @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 35 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: github/codeql-action/init@4187e74d05793876e9989daffde9c3e66b4acd07 # v3.37.3 with: @@ -145,9 +145,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 55 steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 + - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 with: @@ -196,7 +196,7 @@ jobs: - name: Upload full image report if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: trivy-full-${{ matrix.target }} path: trivy-full-${{ matrix.target }}.json diff --git a/apps/web/package.json b/apps/web/package.json index 39bce4a1f..95011bb75 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -17,9 +17,9 @@ "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", "graphology": "0.26.0", - "lucide-react": "^0.562.0", - "react": "^19.2.3", - "react-dom": "^19.2.3", + "lucide-react": "^1.26.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", "sigma": "3.0.3" }, "devDependencies": { @@ -27,7 +27,7 @@ "@vitejs/plugin-react": "^5.1.2", "jsdom": "^27.3.0", "typescript": "^5.9.3", - "vite": "^7.3.0", + "vite": "^8.1.5", "vitest": "^4.0.15" } } diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index ef5ebbe40..d2baf9bfb 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -9,7 +9,7 @@ import { ChevronLeft, ChevronRight, CheckCircle2, - Chrome, + Globe2, CircleHelp, CircleStop, Clipboard, @@ -6405,7 +6405,7 @@ function BrowserDock({