From 375ecef5bf7ebc290cc9f6e809fee22d150a2bda Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 18 Nov 2026 06:55:07 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=92=20urls:=20hosted=20Zoom=20requ?= =?UTF-8?q?ires=20an=20allowlisted=20hostname=20(QUORUM=5FZOOM=5FHOSTED=5F?= =?UTF-8?q?DOMAINS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Any host with a Zoom-shaped path and a passcode was accepted and its URL sent to Vexa as meeting_url. The hosted branch now needs an explicit allowlist (default zoom-lfx.platform.linuxfoundation.org; empty turns it off) and always refuses IP literals, localhost, dotless hosts, URL credentials, http and non-443 ports unless the entry names them. Signed-off-by: Andrew Anderson --- README.md | 5 +- docs/contract.md | 2 +- src/config.ts | 20 ++++++++ src/service.ts | 4 +- src/urls.ts | 114 ++++++++++++++++++++++++++++++++++++++++++-- test/config.test.ts | 20 ++++++++ test/urls.test.ts | 91 ++++++++++++++++++++++++++++++++++- 7 files changed, 246 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 73d0e99..24dcd7e 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Secrets are only ever read from files, on use, so hive can rotate them without a | `QUORUM_TOKEN_FILE` | required | File holding the bearer token for `/mcp` and `/events`. | | `QUORUM_VEXA_URL` | unset | Vexa gateway base URL. Unset: Meet, Teams and Zoom answer `platform_unavailable`. | | `QUORUM_VEXA_API_KEY_FILE` | unset | File holding the tenant Vexa API key (scopes `bot`, `tx`), sent as `X-API-Key`. | +| `QUORUM_ZOOM_HOSTED_DOMAINS` | `zoom-lfx.platform.linuxfoundation.org` | Hostnames allowed for Zoom on an organisation's own domain (comma-separated; `*.suffix` matches subdomains; empty turns it off). See below. | | `QUORUM_VEXA_VOICE` | `false` | Default for `meeting.join` `voice`: start Vexa bots able to speak. | | `QUORUM_VEXA_TIMEOUT_MS` | `15000` | Timeout for each Vexa REST call. | | `QUORUM_VEXA_WS_BACKOFF_MIN_MS` | `1000` | First reconnect delay for the Vexa `/ws` feed. | @@ -76,9 +77,11 @@ Secrets are only ever read from files, on use, so hive can rotate them without a | `QUORUM_MAX_BODY_BYTES` | `1048576` | Largest `/mcp` request body. | | `QUORUM_LOG_LEVEL` | `info` | `debug`, `info`, `warn` or `error`. Logs are JSON lines on stderr. | +Hosted Zoom (`/j/` or `/meeting/` plus `password` or `pwd`) is accepted only for hostnames in `QUORUM_ZOOM_HOSTED_DOMAINS`: exact hostnames, or `*.suffix` / `.suffix` for subdomains of the suffix (never the apex). IP literals, `localhost`, dotless hosts, credentials in the URL, `http` and ports other than 443 (unless the entry says `host:port`) are refused whatever the list holds. **Behavior change:** before, a hosted link on any host was accepted. + ## Platforms -**Google Meet, Teams, Zoom.** `meeting.join {url, display_name, voice?}`. The platform and the native meeting id come from the URL (the same parser Vexa uses: Meet codes and nicknames, Teams `/meet/?p=` short links including government clouds, legacy `meetup-join` links, Zoom `/j/`, `/w/`, `/wc/` links on `zoom.us`, `zoomgov.com` and vanity hosts). The bot joins with recording off. States follow Vexa's bot lifecycle: `requested`, `joining`, `lobby` (awaiting admission), `live`, then `ended`, `failed` (reason `lobby_timeout` when nobody admitted it) or `blocked` (the platform refused a guest bot). `say` needs the bot to have joined with `voice:true` and a Vexa with the speak route (hivecommons/vexa#3); otherwise it answers `platform_unavailable`. A `voice_id` given at join is sent as the `voice` of each speak request. +**Google Meet, Teams, Zoom.** `meeting.join {url, display_name, voice?}`. The platform and the native meeting id come from the URL (the same parser Vexa uses: Meet codes and nicknames, Teams `/meet/?p=` short links including government clouds, legacy `meetup-join` links, Zoom `/j/`, `/w/`, `/wc/` links on `zoom.us` and `zoomgov.com`, and hosted-Zoom links on hosts in `QUORUM_ZOOM_HOSTED_DOMAINS`). The bot joins with recording off. States follow Vexa's bot lifecycle: `requested`, `joining`, `lobby` (awaiting admission), `live`, then `ended`, `failed` (reason `lobby_timeout` when nobody admitted it) or `blocked` (the platform refused a guest bot). `say` needs the bot to have joined with `voice:true` and a Vexa with the speak route (hivecommons/vexa#3); otherwise it answers `platform_unavailable`. A `voice_id` given at join is sent as the `voice` of each speak request. **Companion.** `meeting.join {platform:"companion", display_name, host_name?}`. No bot joins anything: the desktop companion ([hivecommons/quorum-companion](https://github.com/hivecommons/quorum-companion)) captures a person's own meeting client audio (`call`) and microphone (`mic`) after they accept a consent prompt, and hive relays the PCM to `POST /companion/audio`. Each channel is cut at silence and transcribed by the shared Whisper service (`QUORUM_TRANSCRIBE_URL` is required). An utterance is sent for transcription as soon as a short pause (`QUORUM_COMPANION_EARLY_MS`) follows it: the answer is published as a draft segment (`final:false`) and becomes the final segment if the pause runs its full length, so a segment arrives sooner; if the speaker carries on, the utterance is transcribed whole when it ends. `chat.post` lines go to an outbox the companion window reads (`GET /companion/outbox`); `say` answers `platform_unavailable` and `say.prewarm` answers `{queued:0}`. See docs/contract.md, "Companion audio". diff --git a/docs/contract.md b/docs/contract.md index 7b295d9..9588dbf 100644 --- a/docs/contract.md +++ b/docs/contract.md @@ -24,7 +24,7 @@ All tools return `{ok: true, ...}` or `{ok: false, error: {code, message}}`, as | Tool | Arguments | Result | |---|---|---| -| `meeting.join` | `{url, display_name, platform?, voice?, voice_id?}` platform inferred from URL: `google_meet`, `teams`, `zoom`; a Zoom join always sends Vexa `meeting_url` (the https join link, passcode included; `https://zoom.us/j/` for a bare id), which Vexa requires for Zoom; Discord uses `{platform:"discord", guild_id, channel_id}`; the companion uses `{platform:"companion", display_name, host_name?}` (no url; every join starts a new meeting, live at once; `host_name`, at most 100 characters, default `Host`, names the `mic` channel's speaker). `voice` (default `QUORUM_VEXA_VOICE`=false) starts the bot able to speak; Vexa fixes this at join time; Discord ignores it (it can speak whenever `QUORUM_TTS_URL` is set). `voice_id` (optional, at most 100 characters) picks the TTS voice for this meeting's `say`: on Discord the Kokoro voice (default `QUORUM_TTS_VOICE`), on Vexa the `voice` sent with each speak request (Vexa's TTS default when absent). Joining a meeting quorum is already in returns that meeting (and keeps its original `voice_id`). | `{meeting_id, platform, state}` | +| `meeting.join` | `{url, display_name, platform?, voice?, voice_id?}` platform inferred from URL: `google_meet`, `teams`, `zoom`; a Zoom join always sends Vexa `meeting_url` (the https join link, passcode included; `https://zoom.us/j/` for a bare id), which Vexa requires for Zoom; Zoom on an organisation's own domain (`/j/` or `/meeting/` with a passcode) is accepted only for hostnames in `QUORUM_ZOOM_HOSTED_DOMAINS` (default `zoom-lfx.platform.linuxfoundation.org`; comma-separated, `*.suffix` matches subdomains, empty turns it off), https on port 443 only, no URL credentials, never an IP literal or `localhost` (behavior change: any host was accepted before); Discord uses `{platform:"discord", guild_id, channel_id}`; the companion uses `{platform:"companion", display_name, host_name?}` (no url; every join starts a new meeting, live at once; `host_name`, at most 100 characters, default `Host`, names the `mic` channel's speaker). `voice` (default `QUORUM_VEXA_VOICE`=false) starts the bot able to speak; Vexa fixes this at join time; Discord ignores it (it can speak whenever `QUORUM_TTS_URL` is set). `voice_id` (optional, at most 100 characters) picks the TTS voice for this meeting's `say`: on Discord the Kokoro voice (default `QUORUM_TTS_VOICE`), on Vexa the `voice` sent with each speak request (Vexa's TTS default when absent). Joining a meeting quorum is already in returns that meeting (and keeps its original `voice_id`). | `{meeting_id, platform, state}` | | `meeting.leave` | `{meeting_id}` | `{state}`. The bot leaves once what it was already saying has been delivered, waiting at most `QUORUM_LEAVE_DRAIN_TIMEOUT_MS`=8000 (0: no wait), so a last "Leaving now." is heard and posted. On Discord it waits for the queued speech to finish playing. On Vexa it waits for the meeting's `say` queue to settle and for the delivery record of the last `chat.post` line that was sent without `confirm` (a line sent with `confirm:true` was already awaited). When the wait runs out the bot leaves anyway and what was still queued is dropped. If the meeting ends by other means during the wait, its state and reason stand. Discord's `/hive leave` command and `meeting.delete` stop at once, without the wait. | | `meeting.status` | `{meeting_id}` | `{state, participants:[{id,name}]}` | | `transcript.read` | `{meeting_id, after_seq?}` | `{segments:[Segment], next_seq}` final segments only, oldest first; `next_seq` is the cursor to pass back as `after_seq` | diff --git a/src/config.ts b/src/config.ts index e4542bd..157de07 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,7 @@ import { readFileSync } from "node:fs"; import { addSecret } from "./log.js"; import { QuorumError } from "./errors.js"; +import { DEFAULT_ZOOM_HOSTED_DOMAINS, parseHostedZoomList } from "./urls.js"; /** * Runtime configuration, read once from the environment. Every numeric limit is an env var with @@ -79,6 +80,11 @@ export interface Config { transcribeLanguage: string | undefined; /** Vocabulary for the transcription prompt and hotwords (QUORUM_TRANSCRIBE_HOTWORDS, comma-separated). */ transcribeHotwords: string[]; + /** + * Hostnames accepted as Zoom fronted on an organisation's domain (QUORUM_ZOOM_HOSTED_DOMAINS, + * comma-separated; "*.x" or ".x" also matches subdomains). Empty turns the branch off. + */ + zoomHostedDomains: string[]; ttsUrl: string | undefined; ttsTokenFile: string | undefined; ttsVoice: string; @@ -181,6 +187,19 @@ function bool(env: Env, name: string): boolean { throw new Error(`${name} must be true or false, got ${JSON.stringify(v)}`); } +/** Unset: the default allowlist. Set but empty: the hosted-Zoom branch is off. */ +function hostedZoomDomains(env: Env): string[] { + const raw = env["QUORUM_ZOOM_HOSTED_DOMAINS"]; + if (raw === undefined) { + return [...DEFAULT_ZOOM_HOSTED_DOMAINS]; + } + try { + return parseHostedZoomList(raw); + } catch (err) { + throw new Error(`QUORUM_ZOOM_HOSTED_DOMAINS: ${(err as Error).message}`); + } +} + function commandScope(env: Env): DiscordCommandScope { const v = optional(env, "QUORUM_DISCORD_COMMANDS") ?? "guild"; if (v === "guild" || v === "global" || v === "off") { @@ -207,6 +226,7 @@ export function loadConfig(env: Env = process.env): Config { .split(",") .map((w) => w.trim()) .filter(Boolean), + zoomHostedDomains: hostedZoomDomains(env), ttsUrl: optional(env, "QUORUM_TTS_URL")?.replace(/\/+$/, ""), ttsTokenFile: optional(env, "QUORUM_TTS_TOKEN_FILE"), ttsVoice: optional(env, "QUORUM_TTS_VOICE") ?? DEFAULTS.ttsVoice, diff --git a/src/service.ts b/src/service.ts index d38bc75..25a7ca6 100644 --- a/src/service.ts +++ b/src/service.ts @@ -206,7 +206,9 @@ export class Quorum { if (!displayName) { throw new QuorumError("invalid_argument", "display_name must be a non-empty string"); } - const parsed = parseMeetingUrl(url); + const parsed = parseMeetingUrl(url, { + zoomHostedDomains: this.opts.config.zoomHostedDomains, + }); if (platformArg && platformArg !== parsed.platform) { throw new QuorumError( "invalid_argument", diff --git a/src/urls.ts b/src/urls.ts index fe00fcb..4f19273 100644 --- a/src/urls.ts +++ b/src/urls.ts @@ -81,6 +81,94 @@ function zoomMeeting( return { platform: "zoom", nativeId, meetingUrl, ...(passcode ? { passcode } : {}) }; } +/** The one known real deployment of Zoom fronted on an organisation's own domain. */ +export const DEFAULT_ZOOM_HOSTED_DOMAINS: readonly string[] = [ + "zoom-lfx.platform.linuxfoundation.org", +]; + +const HTTPS_DEFAULT_PORT = "443"; +const HOSTNAME_CHARS = /^[a-z0-9.-]+$/; +const ENTRY_PORT = /^(.*):(\d{1,5})$/; + +/** + * Hostnames the hosted-Zoom branch may accept: URL-normalised (lowercase, punycode), either exact + * or, for a "*." or "." entry, any subdomain of the suffix (dot boundary; never the apex itself). + * An entry may end in :port; without one only the https default port is accepted. + */ +interface HostedEntry { + host: string; + suffix: boolean; + port: string; +} + +/** True for a host that is not a plain DNS name: IP literals, localhost, dotless, odd characters. */ +function unsafeHostedHost(host: string): boolean { + if (!HOSTNAME_CHARS.test(host) || !host.includes(".")) { + return true; + } + const labels = host.split("."); + if (labels.some((l) => l === "") || host === "localhost" || host.endsWith(".localhost")) { + return true; + } + // IPv4 in any form the URL parser accepts normalises to dotted digits; a numeric last label never + // belongs to a real domain. + return /^\d+$/.test(labels[labels.length - 1] ?? ""); +} + +export function parseHostedZoomEntries(domains: readonly string[]): HostedEntry[] { + const entries: HostedEntry[] = []; + for (const rawEntry of domains) { + let e = rawEntry.trim().toLowerCase(); + if (!e) { + continue; + } + let suffix = false; + if (e.startsWith("*.")) { + suffix = true; + e = e.slice(2); + } else if (e.startsWith(".")) { + suffix = true; + e = e.slice(1); + } + let port = HTTPS_DEFAULT_PORT; + const pm = ENTRY_PORT.exec(e); + if (pm?.[1] && pm[2]) { + e = pm[1]; + port = pm[2]; + } + let host: string; + try { + host = new URL(`https://${e}`).hostname; + } catch { + throw new Error(`invalid hosted Zoom domain ${JSON.stringify(rawEntry)}`); + } + if (/[/@?#\\]/.test(e) || unsafeHostedHost(host)) { + throw new Error(`invalid hosted Zoom domain ${JSON.stringify(rawEntry)}`); + } + entries.push({ host, suffix, port }); + } + return entries; +} + +/** Parses the comma-separated QUORUM_ZOOM_HOSTED_DOMAINS value into entries; "" disables the branch. */ +export function parseHostedZoomList(raw: string): string[] { + const list = raw + .split(",") + .map((d) => d.trim()) + .filter(Boolean); + parseHostedZoomEntries(list); // validate now so a bad env fails at startup + return list; +} + +function hostedEntryFor(host: string, entries: HostedEntry[]): HostedEntry | undefined { + return entries.find((e) => (e.suffix ? host.endsWith("." + e.host) : host === e.host)); +} + +export interface ParseOptions { + /** Hosted-Zoom allowlist (QUORUM_ZOOM_HOSTED_DOMAINS); default is DEFAULT_ZOOM_HOSTED_DOMAINS. */ + zoomHostedDomains?: readonly string[]; +} + function parseUrl(raw: string): URL { try { return new URL(raw); @@ -89,7 +177,7 @@ function parseUrl(raw: string): URL { } } -export function parseMeetingUrl(input: string): ParsedMeeting { +export function parseMeetingUrl(input: string, options: ParseOptions = {}): ParsedMeeting { const raw = (input ?? "").trim(); if (!raw) { throw invalid("url must not be empty"); @@ -171,12 +259,28 @@ export function parseMeetingUrl(input: string): ParsedMeeting { return zoomMeeting(nativeId, url, passcode); } - // Zoom fronted on an organisation's own domain (zoom-lfx.platform.linuxfoundation.org): - // recognised by Zoom's join path shape plus a passcode, never by the hostname. + // Zoom fronted on an organisation's own domain: only for an explicitly allowlisted hostname + // (never "any host": the URL is handed to a bot that fetches it), and only in Zoom's join path + // shape with a passcode. const hosted = ZOOM_HOSTED_PATH.exec(path); const hostedPass = query.get("password") ?? query.get("pwd"); - if (hosted?.[1] && hostedPass) { - return zoomMeeting(hosted[1], url, hostedPass); + if (hosted?.[1] && hostedPass && !unsafeHostedHost(host)) { + const entry = hostedEntryFor( + host, + parseHostedZoomEntries(options.zoomHostedDomains ?? DEFAULT_ZOOM_HOSTED_DOMAINS), + ); + if (entry) { + if (url.protocol !== "https:") { + throw invalid("hosted Zoom links must be https"); + } + if (url.username || url.password) { + throw invalid("hosted Zoom links must not carry credentials in the URL"); + } + if ((url.port || HTTPS_DEFAULT_PORT) !== entry.port) { + throw invalid(`hosted Zoom link port is not allowed for ${host}`); + } + return zoomMeeting(hosted[1], url, hostedPass); + } } throw invalid(`unsupported meeting host ${host}; supported: Google Meet, Microsoft Teams, Zoom`); diff --git a/test/config.test.ts b/test/config.test.ts index 3d2a59c..35e1dd7 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -10,6 +10,26 @@ import { QuorumError } from "../src/errors.js"; import { clearSecrets, redact } from "../src/log.js"; import { tempDir, writeSecret } from "./helpers/harness.js"; +describe("loadConfig: QUORUM_ZOOM_HOSTED_DOMAINS", () => { + it("defaults to the LFX host only", () => { + expect(loadConfig({}).zoomHostedDomains).toEqual(["zoom-lfx.platform.linuxfoundation.org"]); + }); + + it("an explicitly empty value turns the branch off", () => { + expect(loadConfig({ QUORUM_ZOOM_HOSTED_DOMAINS: "" }).zoomHostedDomains).toEqual([]); + }); + + it("reads a comma-separated list and rejects an unsafe entry", () => { + expect( + loadConfig({ QUORUM_ZOOM_HOSTED_DOMAINS: "a.example.org, *.b.example.org" }) + .zoomHostedDomains, + ).toEqual(["a.example.org", "*.b.example.org"]); + expect(() => loadConfig({ QUORUM_ZOOM_HOSTED_DOMAINS: "127.0.0.1" })).toThrow( + /QUORUM_ZOOM_HOSTED_DOMAINS/, + ); + }); +}); + describe("loadConfig", () => { it("uses the contract defaults", () => { const c = loadConfig({}); diff --git a/test/urls.test.ts b/test/urls.test.ts index 24715d5..7726481 100644 --- a/test/urls.test.ts +++ b/test/urls.test.ts @@ -1,7 +1,12 @@ import { createHash } from "node:crypto"; import { describe, expect, it } from "vitest"; import { QuorumError } from "../src/errors.js"; -import { hostIs, parseMeetingUrl } from "../src/urls.js"; +import { + DEFAULT_ZOOM_HOSTED_DOMAINS, + hostIs, + parseHostedZoomList, + parseMeetingUrl, +} from "../src/urls.js"; describe("parseMeetingUrl: Google Meet", () => { it.each([ @@ -126,7 +131,6 @@ describe("parseMeetingUrl: Zoom", () => { "91234567890", "uuid-1", ], - ["https://events.example.org/j/9123456789?pwd=hosted", "9123456789", "hosted"], ["1234567890", "1234567890", undefined], ])("%s", (url, id, passcode) => { const r = parseMeetingUrl(url); @@ -157,6 +161,89 @@ describe("parseMeetingUrl: Zoom", () => { }); }); +describe("parseMeetingUrl: hosted Zoom allowlist", () => { + const LFX = "zoom-lfx.platform.linuxfoundation.org"; + const path = "/j/1234567890?pwd=x"; + + it("defaults to the LFX host only", () => { + expect(DEFAULT_ZOOM_HOSTED_DOMAINS).toEqual([LFX]); + expect(parseMeetingUrl(`https://${LFX}${path}`)).toMatchObject({ platform: "zoom" }); + expect(parseMeetingUrl(`https://${LFX.toUpperCase()}${path}`).platform).toBe("zoom"); + }); + + it.each([ + "https://events.example.org/j/9123456789?pwd=hosted", + `https://${LFX}.evil.com${path}`, + `https://evilzoom-lfx.platform.linuxfoundation.org${path}`, + `https://evil.${LFX}${path}`, + `https://${LFX}@evil.com${path}`, + "https://127.0.0.1/j/1234567890?pwd=x", + "https://[::1]/j/1234567890?pwd=x", + "https://[2001:db8::1]/j/1234567890?pwd=x", + "https://2130706433/j/1234567890?pwd=x", + "https://localhost/j/1234567890?pwd=x", + "https://intranet/j/1234567890?pwd=x", + ])("refuses %s", (url) => { + expect(() => parseMeetingUrl(url)).toThrow(QuorumError); + }); + + it("refuses an IP literal or localhost even when listed", () => { + expect(() => parseHostedZoomList("127.0.0.1")).toThrow(/invalid hosted Zoom domain/); + expect(() => parseHostedZoomList("[::1]")).toThrow(/invalid hosted Zoom domain/); + expect(() => parseHostedZoomList("localhost")).toThrow(/invalid hosted Zoom domain/); + expect(() => parseHostedZoomList("intranet")).toThrow(/invalid hosted Zoom domain/); + expect(() => parseHostedZoomList("user@zoom.example.org")).toThrow(/invalid/); + }); + + it("refuses credentials in the URL even for an allowed host", () => { + expect(() => parseMeetingUrl(`https://user:pass@${LFX}${path}`)).toThrow(/credentials/); + }); + + it("refuses non-default ports and non-https schemes for an allowed host", () => { + expect(() => parseMeetingUrl(`https://${LFX}:8443${path}`)).toThrow(/port/); + expect(() => parseMeetingUrl(`http://${LFX}${path}`)).toThrow(/https/); + expect(parseMeetingUrl(`https://${LFX}:443${path}`).platform).toBe("zoom"); + }); + + it("accepts a port only when the allowlist entry names it", () => { + const opts = { zoomHostedDomains: ["zoom.example.org:8443"] }; + expect(parseMeetingUrl(`https://zoom.example.org:8443${path}`, opts).platform).toBe("zoom"); + expect(() => parseMeetingUrl(`https://zoom.example.org${path}`, opts)).toThrow(QuorumError); + }); + + it("an empty allowlist turns the hosted branch off", () => { + expect(() => parseMeetingUrl(`https://${LFX}${path}`, { zoomHostedDomains: [] })).toThrow( + /unsupported meeting host/, + ); + expect(parseHostedZoomList("")).toEqual([]); + expect(parseHostedZoomList(" , ")).toEqual([]); + }); + + it("an env-style list can add a second domain", () => { + const opts = { zoomHostedDomains: parseHostedZoomList(`${LFX}, Events.Example.org`) }; + expect(parseMeetingUrl(`https://events.example.org${path}`, opts).platform).toBe("zoom"); + expect(parseMeetingUrl(`https://${LFX}${path}`, opts).platform).toBe("zoom"); + expect(() => parseMeetingUrl(`https://other.example.org${path}`, opts)).toThrow(QuorumError); + }); + + it.each(["*.example.org", ".example.org"])("suffix entry %s matches subdomains only", (entry) => { + const opts = { zoomHostedDomains: [entry] }; + expect(parseMeetingUrl(`https://a.example.org${path}`, opts).platform).toBe("zoom"); + expect(parseMeetingUrl(`https://a.b.example.org${path}`, opts).platform).toBe("zoom"); + expect(() => parseMeetingUrl(`https://example.org${path}`, opts)).toThrow(QuorumError); + expect(() => parseMeetingUrl(`https://evilexample.org${path}`, opts)).toThrow(QuorumError); + expect(() => parseMeetingUrl(`https://a.example.org.evil.com${path}`, opts)).toThrow( + QuorumError, + ); + }); + + it("does not weaken the zoom.us branch when the allowlist is empty", () => { + expect( + parseMeetingUrl("https://zoom.us/j/1234567890?pwd=x", { zoomHostedDomains: [] }).platform, + ).toBe("zoom"); + }); +}); + describe("parseMeetingUrl: everything else", () => { it.each([ ["", /must not be empty/], From 7317abed889f6c5aebda48e3527b89e5ed835ec7 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 18 Nov 2026 06:58:17 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20config:=20attach=20cause=20t?= =?UTF-8?q?o=20the=20QUORUM=5FZOOM=5FHOSTED=5FDOMAINS=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 157de07..8711833 100644 --- a/src/config.ts +++ b/src/config.ts @@ -196,7 +196,7 @@ function hostedZoomDomains(env: Env): string[] { try { return parseHostedZoomList(raw); } catch (err) { - throw new Error(`QUORUM_ZOOM_HOSTED_DOMAINS: ${(err as Error).message}`); + throw new Error(`QUORUM_ZOOM_HOSTED_DOMAINS: ${(err as Error).message}`, { cause: err }); } }