From 3be90c22c271610967d888ba7d1b44661ec0b43c Mon Sep 17 00:00:00 2001 From: r Date: Tue, 10 Nov 2026 11:24:23 -0500 Subject: [PATCH 1/4] fix(ruflo): ship the wrapper only, harden the bridge's outbound guard Socket flags six files in ruflo@3.75.1, all under src/ (the chat UI, the MCP bridge and deploy scripts). Nothing in bin/ reads src/, and the tarball never included the compose files needed to run it, so it was 528 files of dead weight in every install. - package.json: drop src/** from `files`. Tarball goes from 531 files / 8.2 MB to 3 files / 33 KB. New test pins the contents. - mcp-bridge (both copies): replace the SSRF regex with url-guard.js. The regex let through https://[::1]/, 169.254.169.254, 100.64/10, *.internal and IPv4-mapped loopback, and refused public hosts starting "fc"/"fd". The new guard also checks what the hostname resolves to and refuses redirects. - mcp-bridge: pin agentic-flow (was @alpha) and gemini-mcp-server (third-party) to exact versions in the spawn specs and the Dockerfiles. ruvector and ruflo still follow latest. - mcp-bridge: spawned backends no longer inherit MCP_AUTH_TOKEN. - chat-ui: remove patch-mcp-url-safety.sh. Against today's upstream image it matches nothing and exits 0; where it did match it relaxed the check for every URL. - ADR-166 lock: four new checks, plus the guard and tarball tests in CI. Co-Authored-By: RuFlo --- .../workflows/adr-166-mcp-bridge-security.yml | 8 ++ .../adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md | 2 +- ruflo/package.json | 1 - ruflo/rvf.manifest.json | 1 - ruflo/src/chat-ui/Dockerfile | 7 -- ruflo/src/chat-ui/patch-mcp-url-safety.sh | 28 ----- ruflo/src/mcp-bridge/Dockerfile | 5 +- ruflo/src/mcp-bridge/index.js | 56 +++++---- ruflo/src/mcp-bridge/test-security-lock.js | 25 ++++ ruflo/src/mcp-bridge/test-url-guard.mjs | 112 ++++++++++++++++++ ruflo/src/mcp-bridge/url-guard.js | 94 +++++++++++++++ ruflo/src/ruvocal/mcp-bridge/Dockerfile | 5 +- ruflo/src/ruvocal/mcp-bridge/index.js | 56 +++++---- ruflo/src/ruvocal/mcp-bridge/url-guard.js | 94 +++++++++++++++ ruflo/src/scripts/package-rvf.sh | 2 +- ruflo/tests/tarball-contents.test.mjs | 31 +++++ 16 files changed, 436 insertions(+), 91 deletions(-) delete mode 100644 ruflo/src/chat-ui/patch-mcp-url-safety.sh create mode 100644 ruflo/src/mcp-bridge/test-url-guard.mjs create mode 100644 ruflo/src/mcp-bridge/url-guard.js create mode 100644 ruflo/src/ruvocal/mcp-bridge/url-guard.js create mode 100644 ruflo/tests/tarball-contents.test.mjs diff --git a/.github/workflows/adr-166-mcp-bridge-security.yml b/.github/workflows/adr-166-mcp-bridge-security.yml index 4538747c27..5f99835ff0 100644 --- a/.github/workflows/adr-166-mcp-bridge-security.yml +++ b/.github/workflows/adr-166-mcp-bridge-security.yml @@ -12,6 +12,8 @@ on: - 'ruflo/src/ruvocal/mcp-bridge/**' - 'ruflo/docker-compose.yml' - 'ruflo/docker-compose.public.yml' + - 'ruflo/package.json' + - 'ruflo/tests/tarball-contents.test.mjs' - 'v3/@claude-flow/plugin-agent-federation/src/bin.ts' - '.github/workflows/adr-166-mcp-bridge-security.yml' pull_request: @@ -20,6 +22,8 @@ on: - 'ruflo/src/ruvocal/mcp-bridge/**' - 'ruflo/docker-compose.yml' - 'ruflo/docker-compose.public.yml' + - 'ruflo/package.json' + - 'ruflo/tests/tarball-contents.test.mjs' - 'v3/@claude-flow/plugin-agent-federation/src/bin.ts' - '.github/workflows/adr-166-mcp-bridge-security.yml' workflow_dispatch: @@ -35,6 +39,10 @@ jobs: node-version: 22 - name: ADR-166 §6 #9 — anti-regression lock (both bridges) run: node ruflo/src/mcp-bridge/test-security-lock.js + - name: Outbound URL guard (both bridges) + run: node ruflo/src/mcp-bridge/test-url-guard.mjs + - name: ruflo tarball ships the wrapper only + run: node --test ruflo/tests/tarball-contents.test.mjs runtime-behavior: name: Runtime behavior — 401 + terminal gate + fail-closed diff --git a/ruflo/docs/adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md b/ruflo/docs/adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md index 06d2341cf0..e76c71dc45 100644 --- a/ruflo/docs/adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md +++ b/ruflo/docs/adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md @@ -1,7 +1,7 @@ # ADR-032: RVF Private Network MCP Tunnel ## Status -Implemented +Implemented, then the build-time patch was removed (2026-11-10). The `sed` patterns no longer match the upstream image, so the script had become a silent no-op, and where it did match it relaxed the check for every URL, not only operator-configured ones. The ruvocal fork implements the same allowance in source (`isAllowedMcpUrl`, `allowPrivate` for `MCP_SERVERS` entries only). ## Context HuggingFace Chat UI enforces HTTPS-only for MCP server URLs as SSRF protection (`urlSafety.isValidUrl()`). In containerized deployments (Docker Compose), the MCP bridge runs on a private Docker network (`http://mcp-bridge:3001/mcp`) — not exposed to the internet. diff --git a/ruflo/package.json b/ruflo/package.json index e9cb81915a..9003db53dc 100644 --- a/ruflo/package.json +++ b/ruflo/package.json @@ -19,7 +19,6 @@ }, "files": [ "bin/**", - "src/**", "dist/**", "README.md", "LICENSE" diff --git a/ruflo/rvf.manifest.json b/ruflo/rvf.manifest.json index d51b4a0d45..2606c3ad43 100644 --- a/ruflo/rvf.manifest.json +++ b/ruflo/rvf.manifest.json @@ -202,7 +202,6 @@ "private_tunnel": { "protocol": "http", "scope": "docker-network-only", - "patch": "chat-ui/patch-mcp-url-safety.sh", "adr": "docs/adr/ADR-032-RVF-PRIVATE-MCP-TUNNEL.md" }, "env_only_keys": [ diff --git a/ruflo/src/chat-ui/Dockerfile b/ruflo/src/chat-ui/Dockerfile index b56dc028e5..8bbcc7186d 100644 --- a/ruflo/src/chat-ui/Dockerfile +++ b/ruflo/src/chat-ui/Dockerfile @@ -6,13 +6,6 @@ USER root # Bake .env.local with MODELS config (too large for Cloud Run env vars) COPY dotenv-local.txt /app/.env.local -# RVF Security Patch — allow private Docker network MCP connections. -# HF Chat UI enforces HTTPS for MCP URLs (SSRF protection). -# In containerized deployments, MCP bridge runs on private Docker network. -# This patch allows HTTP for admin-configured MCP_SERVERS only. -COPY patch-mcp-url-safety.sh /tmp/patch-mcp-url-safety.sh -RUN sh /tmp/patch-mcp-url-safety.sh && rm /tmp/patch-mcp-url-safety.sh - # Copy branded welcome GIF into the SvelteKit static asset directory. COPY static/chatui/omni-welcome.gif /app/build/client/chatui/omni-welcome.gif COPY static/chatui/omni-welcome.gif /app/static/chatui/omni-welcome.gif diff --git a/ruflo/src/chat-ui/patch-mcp-url-safety.sh b/ruflo/src/chat-ui/patch-mcp-url-safety.sh deleted file mode 100644 index c4cd9acdb8..0000000000 --- a/ruflo/src/chat-ui/patch-mcp-url-safety.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# RVF Security Patch — Allow private network MCP connections -# -# HF Chat UI enforces HTTPS-only for MCP server URLs to prevent SSRF. -# In containerized deployments, MCP servers run on the private Docker -# network (not exposed to the internet). This patch allows HTTP for -# admin-configured MCP_SERVERS URLs while maintaining SSRF protection -# for user-provided URLs. -# -# Security model: -# - MCP_SERVERS is set by the deployment admin (env var / .env.local) -# - Private Docker network is not accessible from the internet -# - The patch only relaxes protocol check, not IP safety checks - -URLSAFETY_FILE=$(find /app/build/server -name "urlSafety-*.js" | head -1) - -if [ -z "$URLSAFETY_FILE" ]; then - echo "[rvf-patch] urlSafety file not found, skipping" - exit 0 -fi - -# Allow http: protocol in addition to https: -sed -i 's/if (url\.protocol !== "https:")/if (url.protocol !== "https:" \&\& url.protocol !== "http:")/' "$URLSAFETY_FILE" - -# Allow localhost for container-internal MCP servers -sed -i 's/if (hostname === "localhost")/if (false \&\& hostname === "localhost")/' "$URLSAFETY_FILE" - -echo "[rvf-patch] Patched $URLSAFETY_FILE for private network MCP" diff --git a/ruflo/src/mcp-bridge/Dockerfile b/ruflo/src/mcp-bridge/Dockerfile index 77210dc73b..9f433a5536 100644 --- a/ruflo/src/mcp-bridge/Dockerfile +++ b/ruflo/src/mcp-bridge/Dockerfile @@ -11,12 +11,13 @@ RUN npm install --production # Each installed separately so one failure doesn't block others RUN npm install -g ruvector || true RUN npm install -g ruflo || true -RUN npm install -g agentic-flow@alpha || true -RUN npm install -g gemini-mcp-server || true +RUN npm install -g agentic-flow@3.5.3 || true +RUN npm install -g gemini-mcp-server@1.2.2 || true RUN npm install -g @openai/codex || true COPY index.js ./ COPY mcp-stdio-kernel.js ./ +COPY url-guard.js ./ # Create writable directories for MCP backends (ruflo, ruvector, agentic-flow) # These tools write state/tasks/memory to the working directory at runtime diff --git a/ruflo/src/mcp-bridge/index.js b/ruflo/src/mcp-bridge/index.js index 05a711e4e3..2e34533fa6 100644 --- a/ruflo/src/mcp-bridge/index.js +++ b/ruflo/src/mcp-bridge/index.js @@ -1,6 +1,7 @@ import express from "express"; import { spawn } from "child_process"; import { randomUUID, timingSafeEqual } from "crypto"; +import { assertPublicUrl } from "./url-guard.js"; // ============================================================================= // CONFIGURATION @@ -84,7 +85,7 @@ const TOOL_GROUPS = { prefixes: ["neural_", "daa_"], }, - // --- Agentic Flow (agentic-flow@alpha) --- + // --- Agentic Flow (agentic-flow, pinned in BACKEND_VERSIONS) --- "agentic-flow": { enabled: process.env.MCP_GROUP_AGENTIC_FLOW === "true", description: "Execute 66+ specialized agents, batch code editing, AgentDB patterns (agentic-flow)", @@ -122,6 +123,15 @@ if (process.env.MCP_GROUP_CODEX === "true") { // STDIO MCP CLIENT — Connects to external MCP servers via child process // ============================================================================= +// Backends inherit the provider keys they need, but not the bridge's own +// bearer token: a backend has no use for it, and holding it would let a +// compromised backend call the bridge as an authenticated client. +function backendEnv() { + const env = { ...process.env }; + delete env.MCP_AUTH_TOKEN; + return env; +} + class StdioMcpClient { constructor(name, command, args = []) { this.name = name; @@ -139,7 +149,7 @@ class StdioMcpClient { try { this.process = spawn(this.command, this.args, { stdio: ["pipe", "pipe", "pipe"], - env: { ...process.env }, + env: backendEnv(), }); this.process.stdout.on("data", (data) => this._onData(data.toString())); @@ -255,12 +265,21 @@ class StdioMcpClient { // BACKEND REGISTRY // ============================================================================= +// Exact versions for backends that are third-party or were tracking a +// pre-release tag, so a new upload cannot change what the bridge executes. +// ruvector and ruflo are first-party and follow `latest`. Keep these in step +// with the Dockerfile's pre-install lines. +const BACKEND_VERSIONS = { + "agentic-flow": "3.5.3", + "gemini-mcp-server": "1.2.2", +}; + const BACKEND_DEFS = [ { name: "ruvector", command: "npx", args: ["-y", "ruvector", "mcp", "start"], groups: ["intelligence"] }, { name: "ruflo", command: "npx", args: ["-y", "ruflo", "mcp", "start"], groups: ["agents", "memory", "devtools", "security", "browser", "neural"] }, - { name: "agentic-flow", command: "npx", args: ["-y", "agentic-flow@alpha", "mcp", "start"], groups: ["agentic-flow"] }, + { name: "agentic-flow", command: "npx", args: ["-y", `agentic-flow@${BACKEND_VERSIONS["agentic-flow"]}`, "mcp", "start"], groups: ["agentic-flow"] }, { name: "claude", command: "claude", args: ["mcp", "serve"], groups: ["claude-code"] }, - { name: "gemini-mcp", command: "npx", args: ["-y", "gemini-mcp-server"], groups: ["gemini"] }, + { name: "gemini-mcp", command: "npx", args: ["-y", `gemini-mcp-server@${BACKEND_VERSIONS["gemini-mcp-server"]}`], groups: ["gemini"] }, ]; const mcpBackends = new Map(); @@ -554,7 +573,7 @@ Neural network operations and Decentralized Autonomous Agents. - Autonomous agent workflows - Knowledge transfer between agents`, - "agentic-flow": `# Agentic Flow Group (agentic-flow@alpha) + "agentic-flow": `# Agentic Flow Group (agentic-flow) Execute 66+ specialized agents with boosted code editing and AgentDB. @@ -635,36 +654,25 @@ Unavailable: current Codex CLI has no MCP server mode (#3509). This group is dis // SSRF GUARD — Reject requests to private/loopback ranges (CWE-918) // ============================================================================= -const PRIVATE_IP_RE = /^(?:10\.|172\.(?:1[6-9]|2\d|3[01])\.|192\.168\.|127\.|0\.|::1|fc|fd)/i; - -function assertSafeUrl(rawUrl) { - let parsed; - try { - parsed = new URL(rawUrl); - } catch { - throw new Error(`SSRF guard: invalid URL — ${rawUrl}`); - } - if (parsed.protocol !== "https:") { - throw new Error(`SSRF guard: only HTTPS URLs are permitted, got ${parsed.protocol}`); - } - const host = parsed.hostname; - if (PRIVATE_IP_RE.test(host) || host === "localhost" || host.endsWith(".local")) { - throw new Error(`SSRF guard: private/loopback host rejected — ${host}`); - } -} +// Implemented in ./url-guard.js so it can be unit-tested (test-url-guard.mjs). // ============================================================================= // HELPER — Call a backend Cloud Function / API // ============================================================================= async function callCloudFunction(url, payload, timeoutMs = 25000) { - // Validate the URL before making any network request. - assertSafeUrl(url); + // Validate the URL, and what it resolves to, before any network request. + try { + await assertPublicUrl(url); + } catch (err) { + return { error: err.message }; + } const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), timeoutMs); try { const resp = await fetch(url, { method: "POST", + redirect: "error", // a redirect could point somewhere the guard never saw headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload), signal: controller.signal, diff --git a/ruflo/src/mcp-bridge/test-security-lock.js b/ruflo/src/mcp-bridge/test-security-lock.js index 383469c35f..3d74bd5e11 100755 --- a/ruflo/src/mcp-bridge/test-security-lock.js +++ b/ruflo/src/mcp-bridge/test-security-lock.js @@ -73,6 +73,16 @@ const CHECKS = [ rx: /Mcp-Session-Id/, hint: "Mcp-Session-Id header must be echoed on /mcp* responses (#2425)", }, + { + id: "10. outbound-url-guard-resolves-dns", + rx: /import\s*\{\s*assertPublicUrl\s*\}\s*from\s*["']\.\/url-guard\.js["'][\s\S]*?async function callCloudFunction[\s\S]*?await assertPublicUrl\(url\)[\s\S]*?redirect:\s*["']error["']/, + hint: "callCloudFunction must await assertPublicUrl (./url-guard.js) and refuse redirects", + }, + { + id: "11. backends-do-not-inherit-bridge-token", + rx: /delete env\.MCP_AUTH_TOKEN[\s\S]*?env:\s*backendEnv\(\)/, + hint: "spawned backends must not receive MCP_AUTH_TOKEN", + }, ]; let hardFail = false; @@ -85,6 +95,14 @@ for (const bridge of BRIDGES) { const src = fs.readFileSync(bridge, "utf-8"); const rel = path.relative(path.join(HERE, "..", ".."), bridge); console.log(`\n# ${rel}`); + const tagged = src.match(/["'`][\w@/.-]+@(?:alpha|beta|next|latest|canary)["'`]/g); + if (tagged) { + console.log(` ✗ 12. no-dist-tag-backend-specs: ${tagged.join(", ")}`); + console.log(" hint: a backend spec must be a bare first-party name or an exact version, never a moving dist-tag"); + hardFail = true; + } else { + console.log(" ✓ 12. no-dist-tag-backend-specs"); + } for (const check of CHECKS) { if (check.rx.test(src)) { console.log(` ✓ ${check.id}`); @@ -105,6 +123,13 @@ for (const dockerfile of DOCKERFILES) { const source = fs.readFileSync(dockerfile, "utf-8"); const rel = path.relative(path.join(HERE, "..", ".."), dockerfile); console.log(`\n# ${rel}`); + if (/^COPY\s+url-guard\.js\s/m.test(source)) { + console.log(" ✓ 13. image-includes-url-guard"); + } else { + console.log(" ✗ 13. image-includes-url-guard"); + console.log(" hint: the image must COPY url-guard.js or the bridge fails to start"); + hardFail = true; + } if (/^FROM\s+node:24(?:[.-][^\s]+)?\s*$/m.test(source)) { console.log(" ✓ 9. supported-node-lts-runtime (#2847)"); } else { diff --git a/ruflo/src/mcp-bridge/test-url-guard.mjs b/ruflo/src/mcp-bridge/test-url-guard.mjs new file mode 100644 index 0000000000..610e53429f --- /dev/null +++ b/ruflo/src/mcp-bridge/test-url-guard.mjs @@ -0,0 +1,112 @@ +#!/usr/bin/env node +// SSRF guard tests for both bridge copies. Run: node test-url-guard.mjs +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const COPIES = [ + path.join(HERE, "url-guard.js"), + path.join(HERE, "..", "ruvocal", "mcp-bridge", "url-guard.js"), +]; + +assert.equal( + fs.readFileSync(COPIES[0], "utf8"), + fs.readFileSync(COPIES[1], "utf8"), + "the two url-guard.js copies must be byte-identical", +); + +const REJECTED = [ + "http://example.com/", // not HTTPS + "file:///etc/passwd", + "not a url", + "https://localhost/", + "https://LOCALHOST./", // case and trailing dot + "https://api.localhost/", + "https://printer.local/", + "https://metadata.google.internal/", + "https://mcp-bridge/", // dotless Docker service name + "https://127.0.0.1/", + "https://2130706433/", // 127.0.0.1 as a decimal integer + "https://0x7f.1/", // 127.0.0.1 in hex shorthand + "https://0.0.0.0/", + "https://10.1.2.3/", + "https://172.16.0.1/", + "https://172.31.255.255/", + "https://192.168.1.1/", + "https://169.254.169.254/latest/meta-data/", // cloud metadata + "https://100.64.0.1/", // carrier-grade NAT + "https://224.0.0.1/", + "https://255.255.255.255/", + "https://[::1]/", + "https://[::]/", + "https://[::ffff:127.0.0.1]/", // IPv4-mapped loopback + "https://[::ffff:169.254.169.254]/", + "https://[fc00::1]/", + "https://[fd12:3456::1]/", + "https://[fe80::1]/", + "https://[64:ff9b::7f00:1]/", // NAT64 of 127.0.0.1 +]; + +const ACCEPTED = [ + "https://example.com/path?x=1", + "https://us-central1-proj.cloudfunctions.net/search", + "https://fcc.gov/", // the old regex refused any host starting "fc"/"fd" + "https://fda.gov/", + "https://172.15.0.1/", // just outside 172.16/12 + "https://172.32.0.1/", + "https://8.8.8.8/", + "https://[2606:4700:4700::1111]/", +]; + +let failures = 0; +const check = (name, fn) => { + try { fn(); console.log(` ✓ ${name}`); } + catch (err) { failures++; console.log(` ✗ ${name}\n ${err.message}`); } +}; +const checkAsync = async (name, fn) => { + try { await fn(); console.log(` ✓ ${name}`); } + catch (err) { failures++; console.log(` ✗ ${name}\n ${err.message}`); } +}; + +for (const file of COPIES) { + console.log(`\n# ${path.relative(path.join(HERE, "..", ".."), file)}`); + const { assertSafeUrl, assertPublicUrl, isBlockedAddress } = await import(pathToFileURL(file).href); + + for (const url of REJECTED) { + check(`rejects ${url}`, () => assert.throws(() => assertSafeUrl(url), /SSRF guard/)); + } + for (const url of ACCEPTED) { + check(`accepts ${url}`, () => assert.doesNotThrow(() => assertSafeUrl(url))); + } + check("an invalid-URL error does not echo the input", () => { + assert.throws(() => assertSafeUrl("https://user:secret@"), (err) => !err.message.includes("secret")); + }); + check("a non-IP string is treated as blocked", () => assert.equal(isBlockedAddress("example.com"), true)); + + const resolvesTo = (...addresses) => async () => addresses.map((address) => ({ address })); + await checkAsync("refuses a public name that resolves to loopback", () => + assert.rejects(assertPublicUrl("https://rebind.example.com/", resolvesTo("127.0.0.1")), /resolves to a private/)); + await checkAsync("refuses when any one resolved address is private", () => + assert.rejects(assertPublicUrl("https://rebind.example.com/", resolvesTo("93.184.216.34", "10.0.0.5")), /resolves to a private/)); + await checkAsync("refuses a name that resolves to the metadata address over IPv6-mapped IPv4", () => + assert.rejects(assertPublicUrl("https://rebind.example.com/", resolvesTo("::ffff:169.254.169.254")), /resolves to a private/)); + await checkAsync("refuses a name that does not resolve", () => + assert.rejects(assertPublicUrl("https://nothing.example.com/", resolvesTo()), /did not resolve/)); + await checkAsync("accepts a name that resolves only to public addresses", async () => { + const parsed = await assertPublicUrl("https://ok.example.com/x", resolvesTo("93.184.216.34", "2606:4700:4700::1111")); + assert.equal(parsed.hostname, "ok.example.com"); + }); + await checkAsync("does not resolve an IP literal", async () => { + await assertPublicUrl("https://8.8.8.8/", async () => { throw new Error("lookup must not be called"); }); + }); + await checkAsync("rejects before resolving when the URL itself is unsafe", () => + assert.rejects(assertPublicUrl("http://example.com/", async () => { throw new Error("lookup must not be called"); }), /only HTTPS/)); +} + +if (failures) { + console.error(`\n${failures} check(s) failed`); + process.exit(1); +} +console.log("\nurl-guard: all checks passed"); diff --git a/ruflo/src/mcp-bridge/url-guard.js b/ruflo/src/mcp-bridge/url-guard.js new file mode 100644 index 0000000000..15d6924498 --- /dev/null +++ b/ruflo/src/mcp-bridge/url-guard.js @@ -0,0 +1,94 @@ +// SSRF guard for the bridge's outbound calls (CWE-918). +// +// Only public HTTPS endpoints pass. The hostname is checked as written and, +// in assertPublicUrl, again after DNS resolution, so a public name that +// resolves to a private address is refused too. +// +// This file exists twice (src/mcp-bridge and src/ruvocal/mcp-bridge) and the +// copies must stay byte-identical; test-url-guard.mjs fails if they drift. +import { BlockList, isIP } from "node:net"; +import { lookup as dnsLookup } from "node:dns/promises"; + +const BLOCKED = new BlockList(); +for (const [net, prefix] of [ + ["0.0.0.0", 8], // "this network" + ["10.0.0.0", 8], // private + ["100.64.0.0", 10], // carrier-grade NAT + ["127.0.0.0", 8], // loopback + ["169.254.0.0", 16], // link-local, cloud metadata + ["172.16.0.0", 12], // private + ["192.0.0.0", 24], // IETF protocol assignments + ["192.168.0.0", 16], // private + ["198.18.0.0", 15], // benchmarking + ["224.0.0.0", 4], // multicast + ["240.0.0.0", 4], // reserved, broadcast +]) BLOCKED.addSubnet(net, prefix, "ipv4"); +for (const [net, prefix] of [ + ["::", 128], // unspecified + ["::1", 128], // loopback + ["64:ff9b::", 96], // NAT64, maps onto IPv4 + ["fc00::", 7], // unique-local + ["fe80::", 10], // link-local + ["ff00::", 8], // multicast +]) BLOCKED.addSubnet(net, prefix, "ipv6"); + +/** True when an IP literal is loopback, private, link-local or otherwise not public. */ +export function isBlockedAddress(address) { + const family = isIP(address); + if (family === 4) return BLOCKED.check(address, "ipv4"); + // An IPv4-mapped IPv6 address is matched against the IPv4 rules as well. + if (family === 6) return BLOCKED.check(address, "ipv6"); + return true; // not an IP literal: refuse instead of guessing +} + +function bareHostname(parsed) { + return parsed.hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, ""); +} + +/** Synchronous check of the URL as written. Throws on anything not public HTTPS. */ +export function assertSafeUrl(rawUrl) { + let parsed; + try { + parsed = new URL(rawUrl); + } catch { + throw new Error("SSRF guard: invalid URL"); + } + if (parsed.protocol !== "https:") { + throw new Error(`SSRF guard: only HTTPS URLs are permitted, got ${parsed.protocol}`); + } + const host = bareHostname(parsed); + if (isIP(host)) { + if (isBlockedAddress(host)) { + throw new Error(`SSRF guard: private/loopback address rejected — ${host}`); + } + return parsed; + } + if ( + !host.includes(".") || + host === "localhost" || + host.endsWith(".localhost") || + host.endsWith(".local") || + host.endsWith(".internal") + ) { + throw new Error(`SSRF guard: private/loopback host rejected — ${host}`); + } + return parsed; +} + +/** + * assertSafeUrl plus a check of every address the hostname resolves to. + * `lookup` is injectable for tests. + */ +export async function assertPublicUrl(rawUrl, lookup = dnsLookup) { + const parsed = assertSafeUrl(rawUrl); + const host = bareHostname(parsed); + if (isIP(host)) return parsed; + const addresses = await lookup(host, { all: true }); + if (!addresses.length) throw new Error(`SSRF guard: ${host} did not resolve`); + for (const { address } of addresses) { + if (isBlockedAddress(address)) { + throw new Error(`SSRF guard: ${host} resolves to a private/loopback address (${address})`); + } + } + return parsed; +} diff --git a/ruflo/src/ruvocal/mcp-bridge/Dockerfile b/ruflo/src/ruvocal/mcp-bridge/Dockerfile index 77210dc73b..9f433a5536 100644 --- a/ruflo/src/ruvocal/mcp-bridge/Dockerfile +++ b/ruflo/src/ruvocal/mcp-bridge/Dockerfile @@ -11,12 +11,13 @@ RUN npm install --production # Each installed separately so one failure doesn't block others RUN npm install -g ruvector || true RUN npm install -g ruflo || true -RUN npm install -g agentic-flow@alpha || true -RUN npm install -g gemini-mcp-server || true +RUN npm install -g agentic-flow@3.5.3 || true +RUN npm install -g gemini-mcp-server@1.2.2 || true RUN npm install -g @openai/codex || true COPY index.js ./ COPY mcp-stdio-kernel.js ./ +COPY url-guard.js ./ # Create writable directories for MCP backends (ruflo, ruvector, agentic-flow) # These tools write state/tasks/memory to the working directory at runtime diff --git a/ruflo/src/ruvocal/mcp-bridge/index.js b/ruflo/src/ruvocal/mcp-bridge/index.js index 338bba788b..bc9c7394eb 100644 --- a/ruflo/src/ruvocal/mcp-bridge/index.js +++ b/ruflo/src/ruvocal/mcp-bridge/index.js @@ -1,6 +1,7 @@ import express from "express"; import { spawn } from "child_process"; import { randomUUID, timingSafeEqual } from "crypto"; +import { assertPublicUrl } from "./url-guard.js"; // ============================================================================= // CONFIGURATION @@ -84,7 +85,7 @@ const TOOL_GROUPS = { prefixes: ["neural_", "daa_"], }, - // --- Agentic Flow (agentic-flow@alpha) --- + // --- Agentic Flow (agentic-flow, pinned in BACKEND_VERSIONS) --- "agentic-flow": { enabled: process.env.MCP_GROUP_AGENTIC_FLOW === "true", description: "Execute 66+ specialized agents, batch code editing, AgentDB patterns (agentic-flow)", @@ -122,6 +123,15 @@ if (process.env.MCP_GROUP_CODEX === "true") { // STDIO MCP CLIENT — Connects to external MCP servers via child process // ============================================================================= +// Backends inherit the provider keys they need, but not the bridge's own +// bearer token: a backend has no use for it, and holding it would let a +// compromised backend call the bridge as an authenticated client. +function backendEnv() { + const env = { ...process.env }; + delete env.MCP_AUTH_TOKEN; + return env; +} + class StdioMcpClient { constructor(name, command, args = []) { this.name = name; @@ -139,7 +149,7 @@ class StdioMcpClient { try { this.process = spawn(this.command, this.args, { stdio: ["pipe", "pipe", "pipe"], - env: { ...process.env }, + env: backendEnv(), }); this.process.stdout.on("data", (data) => this._onData(data.toString())); @@ -260,12 +270,21 @@ class StdioMcpClient { // BACKEND REGISTRY // ============================================================================= +// Exact versions for backends that are third-party or were tracking a +// pre-release tag, so a new upload cannot change what the bridge executes. +// ruvector and ruflo are first-party and follow `latest`. Keep these in step +// with the Dockerfile's pre-install lines. +const BACKEND_VERSIONS = { + "agentic-flow": "3.5.3", + "gemini-mcp-server": "1.2.2", +}; + const BACKEND_DEFS = [ { name: "ruvector", command: "npx", args: ["-y", "ruvector", "mcp", "start"], groups: ["intelligence"] }, { name: "ruflo", command: "npx", args: ["-y", "ruflo", "mcp", "start"], groups: ["agents", "memory", "devtools", "security", "browser", "neural"] }, - { name: "agentic-flow", command: "npx", args: ["-y", "agentic-flow@alpha", "mcp", "start"], groups: ["agentic-flow"] }, + { name: "agentic-flow", command: "npx", args: ["-y", `agentic-flow@${BACKEND_VERSIONS["agentic-flow"]}`, "mcp", "start"], groups: ["agentic-flow"] }, { name: "claude", command: "claude", args: ["mcp", "serve"], groups: ["claude-code"] }, - { name: "gemini-mcp", command: "npx", args: ["-y", "gemini-mcp-server"], groups: ["gemini"] }, + { name: "gemini-mcp", command: "npx", args: ["-y", `gemini-mcp-server@${BACKEND_VERSIONS["gemini-mcp-server"]}`], groups: ["gemini"] }, ]; const mcpBackends = new Map(); @@ -559,7 +578,7 @@ Neural network operations and Decentralized Autonomous Agents. - Autonomous agent workflows - Knowledge transfer between agents`, - "agentic-flow": `# Agentic Flow Group (agentic-flow@alpha) + "agentic-flow": `# Agentic Flow Group (agentic-flow) Execute 66+ specialized agents with boosted code editing and AgentDB. @@ -724,36 +743,25 @@ async function geminiGroundedSearch(query, mode = "search") { // SSRF GUARD — Reject requests to private/loopback ranges (CWE-918) // ============================================================================= -const PRIVATE_IP_RE = /^(?:10\.|172\.(?:1[6-9]|2\d|3[01])\.|192\.168\.|127\.|0\.|::1|fc|fd)/i; - -function assertSafeUrl(rawUrl) { - let parsed; - try { - parsed = new URL(rawUrl); - } catch { - throw new Error(`SSRF guard: invalid URL — ${rawUrl}`); - } - if (parsed.protocol !== "https:") { - throw new Error(`SSRF guard: only HTTPS URLs are permitted, got ${parsed.protocol}`); - } - const host = parsed.hostname; - if (PRIVATE_IP_RE.test(host) || host === "localhost" || host.endsWith(".local")) { - throw new Error(`SSRF guard: private/loopback host rejected — ${host}`); - } -} +// Implemented in ./url-guard.js so it can be unit-tested (test-url-guard.mjs). // ============================================================================= // HELPER — Call a backend Cloud Function / API // ============================================================================= async function callCloudFunction(url, payload, timeoutMs = 25000) { - // Validate the URL before making any network request. - assertSafeUrl(url); + // Validate the URL, and what it resolves to, before any network request. + try { + await assertPublicUrl(url); + } catch (err) { + return { error: err.message }; + } const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), timeoutMs); try { const resp = await fetch(url, { method: "POST", + redirect: "error", // a redirect could point somewhere the guard never saw headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload), signal: controller.signal, diff --git a/ruflo/src/ruvocal/mcp-bridge/url-guard.js b/ruflo/src/ruvocal/mcp-bridge/url-guard.js new file mode 100644 index 0000000000..15d6924498 --- /dev/null +++ b/ruflo/src/ruvocal/mcp-bridge/url-guard.js @@ -0,0 +1,94 @@ +// SSRF guard for the bridge's outbound calls (CWE-918). +// +// Only public HTTPS endpoints pass. The hostname is checked as written and, +// in assertPublicUrl, again after DNS resolution, so a public name that +// resolves to a private address is refused too. +// +// This file exists twice (src/mcp-bridge and src/ruvocal/mcp-bridge) and the +// copies must stay byte-identical; test-url-guard.mjs fails if they drift. +import { BlockList, isIP } from "node:net"; +import { lookup as dnsLookup } from "node:dns/promises"; + +const BLOCKED = new BlockList(); +for (const [net, prefix] of [ + ["0.0.0.0", 8], // "this network" + ["10.0.0.0", 8], // private + ["100.64.0.0", 10], // carrier-grade NAT + ["127.0.0.0", 8], // loopback + ["169.254.0.0", 16], // link-local, cloud metadata + ["172.16.0.0", 12], // private + ["192.0.0.0", 24], // IETF protocol assignments + ["192.168.0.0", 16], // private + ["198.18.0.0", 15], // benchmarking + ["224.0.0.0", 4], // multicast + ["240.0.0.0", 4], // reserved, broadcast +]) BLOCKED.addSubnet(net, prefix, "ipv4"); +for (const [net, prefix] of [ + ["::", 128], // unspecified + ["::1", 128], // loopback + ["64:ff9b::", 96], // NAT64, maps onto IPv4 + ["fc00::", 7], // unique-local + ["fe80::", 10], // link-local + ["ff00::", 8], // multicast +]) BLOCKED.addSubnet(net, prefix, "ipv6"); + +/** True when an IP literal is loopback, private, link-local or otherwise not public. */ +export function isBlockedAddress(address) { + const family = isIP(address); + if (family === 4) return BLOCKED.check(address, "ipv4"); + // An IPv4-mapped IPv6 address is matched against the IPv4 rules as well. + if (family === 6) return BLOCKED.check(address, "ipv6"); + return true; // not an IP literal: refuse instead of guessing +} + +function bareHostname(parsed) { + return parsed.hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, ""); +} + +/** Synchronous check of the URL as written. Throws on anything not public HTTPS. */ +export function assertSafeUrl(rawUrl) { + let parsed; + try { + parsed = new URL(rawUrl); + } catch { + throw new Error("SSRF guard: invalid URL"); + } + if (parsed.protocol !== "https:") { + throw new Error(`SSRF guard: only HTTPS URLs are permitted, got ${parsed.protocol}`); + } + const host = bareHostname(parsed); + if (isIP(host)) { + if (isBlockedAddress(host)) { + throw new Error(`SSRF guard: private/loopback address rejected — ${host}`); + } + return parsed; + } + if ( + !host.includes(".") || + host === "localhost" || + host.endsWith(".localhost") || + host.endsWith(".local") || + host.endsWith(".internal") + ) { + throw new Error(`SSRF guard: private/loopback host rejected — ${host}`); + } + return parsed; +} + +/** + * assertSafeUrl plus a check of every address the hostname resolves to. + * `lookup` is injectable for tests. + */ +export async function assertPublicUrl(rawUrl, lookup = dnsLookup) { + const parsed = assertSafeUrl(rawUrl); + const host = bareHostname(parsed); + if (isIP(host)) return parsed; + const addresses = await lookup(host, { all: true }); + if (!addresses.length) throw new Error(`SSRF guard: ${host} did not resolve`); + for (const { address } of addresses) { + if (isBlockedAddress(address)) { + throw new Error(`SSRF guard: ${host} resolves to a private/loopback address (${address})`); + } + } + return parsed; +} diff --git a/ruflo/src/scripts/package-rvf.sh b/ruflo/src/scripts/package-rvf.sh index 4ead70deb9..5e87b087e5 100755 --- a/ruflo/src/scripts/package-rvf.sh +++ b/ruflo/src/scripts/package-rvf.sh @@ -80,7 +80,7 @@ tar czf "$OUTPUT" \ mcp-bridge/package.json \ mcp-bridge/Dockerfile \ chat-ui/Dockerfile \ - chat-ui/patch-mcp-url-safety.sh \ + mcp-bridge/url-guard.js \ chat-ui/static/ \ mcp-bridge/mcp-stdio-kernel.js \ mcp-bridge/test-harness.js \ diff --git a/ruflo/tests/tarball-contents.test.mjs b/ruflo/tests/tarball-contents.test.mjs new file mode 100644 index 0000000000..8507bbd374 --- /dev/null +++ b/ruflo/tests/tarball-contents.test.mjs @@ -0,0 +1,31 @@ +// The published `ruflo` package is the CLI wrapper only. The chat UI, the MCP +// bridge and the deploy scripts under src/ are built from the repo (Docker, +// Cloud Build) and nothing in bin/ reads them, so they stay out of the tarball. +import assert from 'node:assert/strict'; +import { execFileSync } from 'node:child_process'; +import { dirname, resolve } from 'node:path'; +import test from 'node:test'; +import { fileURLToPath } from 'node:url'; + +const packageDir = resolve(dirname(fileURLToPath(import.meta.url)), '..'); + +function packedFiles() { + const out = execFileSync( + process.platform === 'win32' ? 'npm.cmd' : 'npm', + ['pack', '--dry-run', '--json', '--ignore-scripts'], + { cwd: packageDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], shell: process.platform === 'win32' }, + ); + return JSON.parse(out)[0].files.map((f) => f.path); +} + +test('the ruflo tarball ships the wrapper and nothing from src/', () => { + const files = packedFiles(); + assert.ok(files.length > 0, 'npm pack listed no files'); + assert.ok(files.includes('bin/ruflo.js'), 'bin/ruflo.js must ship'); + assert.ok(files.includes('package.json'), 'package.json must ship'); + + const allowed = (p) => p.startsWith('bin/') || p.startsWith('dist/') + || ['package.json', 'README.md', 'LICENSE'].includes(p); + const unexpected = files.filter((p) => !allowed(p)); + assert.deepEqual(unexpected, [], `unexpected files in the ruflo tarball: ${unexpected.slice(0, 10).join(', ')}`); +}); From 29e635c9fb3d3eef61ae22af4fdc9b2dafa760b9 Mon Sep 17 00:00:00 2001 From: r Date: Tue, 10 Nov 2026 11:32:05 -0500 Subject: [PATCH 2/4] fix(ruflo): pin agentic-flow to the version the alpha tag resolved to 3.5.3 no longer exposes agentic_flow_agent, agent_booster_edit_file, agent_booster_batch_edit or agentdb_pattern_store, which the bridge's help text advertises. 3.0.0-alpha.2 is what @alpha resolves to today, so pinning it removes the moving tag without changing the tool surface. Co-Authored-By: RuFlo --- ruflo/src/mcp-bridge/Dockerfile | 2 +- ruflo/src/mcp-bridge/index.js | 2 +- ruflo/src/ruvocal/mcp-bridge/Dockerfile | 2 +- ruflo/src/ruvocal/mcp-bridge/index.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruflo/src/mcp-bridge/Dockerfile b/ruflo/src/mcp-bridge/Dockerfile index 9f433a5536..0de4505cc1 100644 --- a/ruflo/src/mcp-bridge/Dockerfile +++ b/ruflo/src/mcp-bridge/Dockerfile @@ -11,7 +11,7 @@ RUN npm install --production # Each installed separately so one failure doesn't block others RUN npm install -g ruvector || true RUN npm install -g ruflo || true -RUN npm install -g agentic-flow@3.5.3 || true +RUN npm install -g agentic-flow@3.0.0-alpha.2 || true RUN npm install -g gemini-mcp-server@1.2.2 || true RUN npm install -g @openai/codex || true diff --git a/ruflo/src/mcp-bridge/index.js b/ruflo/src/mcp-bridge/index.js index 2e34533fa6..9eb0adad37 100644 --- a/ruflo/src/mcp-bridge/index.js +++ b/ruflo/src/mcp-bridge/index.js @@ -270,7 +270,7 @@ class StdioMcpClient { // ruvector and ruflo are first-party and follow `latest`. Keep these in step // with the Dockerfile's pre-install lines. const BACKEND_VERSIONS = { - "agentic-flow": "3.5.3", + "agentic-flow": "3.0.0-alpha.2", // what the `alpha` tag resolved to; 3.5.3 drops tools the help text lists "gemini-mcp-server": "1.2.2", }; diff --git a/ruflo/src/ruvocal/mcp-bridge/Dockerfile b/ruflo/src/ruvocal/mcp-bridge/Dockerfile index 9f433a5536..0de4505cc1 100644 --- a/ruflo/src/ruvocal/mcp-bridge/Dockerfile +++ b/ruflo/src/ruvocal/mcp-bridge/Dockerfile @@ -11,7 +11,7 @@ RUN npm install --production # Each installed separately so one failure doesn't block others RUN npm install -g ruvector || true RUN npm install -g ruflo || true -RUN npm install -g agentic-flow@3.5.3 || true +RUN npm install -g agentic-flow@3.0.0-alpha.2 || true RUN npm install -g gemini-mcp-server@1.2.2 || true RUN npm install -g @openai/codex || true diff --git a/ruflo/src/ruvocal/mcp-bridge/index.js b/ruflo/src/ruvocal/mcp-bridge/index.js index bc9c7394eb..072d8279ec 100644 --- a/ruflo/src/ruvocal/mcp-bridge/index.js +++ b/ruflo/src/ruvocal/mcp-bridge/index.js @@ -275,7 +275,7 @@ class StdioMcpClient { // ruvector and ruflo are first-party and follow `latest`. Keep these in step // with the Dockerfile's pre-install lines. const BACKEND_VERSIONS = { - "agentic-flow": "3.5.3", + "agentic-flow": "3.0.0-alpha.2", // what the `alpha` tag resolved to; 3.5.3 drops tools the help text lists "gemini-mcp-server": "1.2.2", }; From 9d1202e40cee9f33497006fd5b1ee48b77a7428c Mon Sep 17 00:00:00 2001 From: r Date: Tue, 10 Nov 2026 11:35:33 -0500 Subject: [PATCH 3/4] chore(release): 3.75.2 Co-Authored-By: RuFlo --- package-lock.json | 4 ++-- package.json | 2 +- ruflo/package.json | 4 ++-- ruflo/server.json | 4 ++-- v3/@claude-flow/cli/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 956d931cb9..2ecf4f54f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claude-flow", - "version": "3.75.1", + "version": "3.75.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claude-flow", - "version": "3.75.1", + "version": "3.75.2", "bundleDependencies": [ "@claude-flow/codex", "@claude-flow/mcp", diff --git a/package.json b/package.json index 6bf5a7dc70..ae0dd64473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-flow", - "version": "3.75.1", + "version": "3.75.2", "workspaces": [ "v3/@claude-flow/codex", "v3/@claude-flow/mcp", diff --git a/ruflo/package.json b/ruflo/package.json index 9003db53dc..8f2bc9c97a 100644 --- a/ruflo/package.json +++ b/ruflo/package.json @@ -1,7 +1,7 @@ { "name": "ruflo", "mcpName": "io.github.ruvnet/ruflo", - "version": "3.75.1", + "version": "3.75.2", "description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "bin/ruflo.js", "type": "module", @@ -40,7 +40,7 @@ "package:rvf": "bash src/scripts/package-rvf.sh" }, "dependencies": { - "@claude-flow/cli": "3.75.1" + "@claude-flow/cli": "3.75.2" }, "optionalDependencies": {}, "overrides": { diff --git a/ruflo/server.json b/ruflo/server.json index 11982aeb74..5ef4461c88 100644 --- a/ruflo/server.json +++ b/ruflo/server.json @@ -9,12 +9,12 @@ "subfolder": "ruflo" }, "websiteUrl": "https://github.com/ruvnet/ruflo", - "version": "3.75.1", + "version": "3.75.2", "packages": [ { "registryType": "npm", "identifier": "ruflo", - "version": "3.75.1", + "version": "3.75.2", "runtimeHint": "npx", "transport": { "type": "stdio" diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json index dd17ff766b..2e693f58d4 100644 --- a/v3/@claude-flow/cli/package.json +++ b/v3/@claude-flow/cli/package.json @@ -1,6 +1,6 @@ { "name": "@claude-flow/cli", - "version": "3.75.1", + "version": "3.75.2", "type": "module", "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code", "main": "dist/src/index.js", From 0a311ac4c43cfe3ca8c627aab7bada41fa1954a7 Mon Sep 17 00:00:00 2001 From: r Date: Tue, 10 Nov 2026 11:54:50 -0500 Subject: [PATCH 4/4] test(ruflo): run the tarball-contents test under vitest, where the CI ratchet collects it Co-Authored-By: RuFlo --- .github/workflows/adr-166-mcp-bridge-security.yml | 6 ------ ruflo/tests/tarball-contents.test.mjs | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/adr-166-mcp-bridge-security.yml b/.github/workflows/adr-166-mcp-bridge-security.yml index 5f99835ff0..c6def55735 100644 --- a/.github/workflows/adr-166-mcp-bridge-security.yml +++ b/.github/workflows/adr-166-mcp-bridge-security.yml @@ -12,8 +12,6 @@ on: - 'ruflo/src/ruvocal/mcp-bridge/**' - 'ruflo/docker-compose.yml' - 'ruflo/docker-compose.public.yml' - - 'ruflo/package.json' - - 'ruflo/tests/tarball-contents.test.mjs' - 'v3/@claude-flow/plugin-agent-federation/src/bin.ts' - '.github/workflows/adr-166-mcp-bridge-security.yml' pull_request: @@ -22,8 +20,6 @@ on: - 'ruflo/src/ruvocal/mcp-bridge/**' - 'ruflo/docker-compose.yml' - 'ruflo/docker-compose.public.yml' - - 'ruflo/package.json' - - 'ruflo/tests/tarball-contents.test.mjs' - 'v3/@claude-flow/plugin-agent-federation/src/bin.ts' - '.github/workflows/adr-166-mcp-bridge-security.yml' workflow_dispatch: @@ -41,8 +37,6 @@ jobs: run: node ruflo/src/mcp-bridge/test-security-lock.js - name: Outbound URL guard (both bridges) run: node ruflo/src/mcp-bridge/test-url-guard.mjs - - name: ruflo tarball ships the wrapper only - run: node --test ruflo/tests/tarball-contents.test.mjs runtime-behavior: name: Runtime behavior — 401 + terminal gate + fail-closed diff --git a/ruflo/tests/tarball-contents.test.mjs b/ruflo/tests/tarball-contents.test.mjs index 8507bbd374..6c03b34b96 100644 --- a/ruflo/tests/tarball-contents.test.mjs +++ b/ruflo/tests/tarball-contents.test.mjs @@ -4,7 +4,7 @@ import assert from 'node:assert/strict'; import { execFileSync } from 'node:child_process'; import { dirname, resolve } from 'node:path'; -import test from 'node:test'; +import { test } from 'vitest'; import { fileURLToPath } from 'node:url'; const packageDir = resolve(dirname(fileURLToPath(import.meta.url)), '..');