Skip to content

[web] Add option to configure allowed hosts - #5671

Open
VaguelySerious wants to merge 1 commit into
mainfrom
peter/web-allowed-hosts
Open

VaguelySerious wants to merge 1 commit into
mainfrom
peter/web-allowed-hosts

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Adds --webAllowedHosts / WORKFLOW_WEB_ALLOWED_HOSTS to configure which host names the web UI server accepts. By default it accepts localhost, *.localhost, and IP addresses.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code owner November 23, 2026 18:27
@changeset-bot

changeset-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0e52833

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/world-cloudflare Patch
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/web-shared Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
example-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-python-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workflow-docs Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC
workflow-web Ready Ready Preview, v0 Nov 23, 2026 6:31pm UTC

@github-actions

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

⏳ Tests are running...

This comment will be updated with the results when the tests complete.


_Started at: _

@github-actions

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

⏳ Benchmarks are running for 0e52833... (run logs)

ℹ️ Metric definitions & methodology

Metrics —

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies. Streaming delivery performance is measured in durabench.

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟢 world-sim scenario book — 0 fail of 45 total
scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 5 0ms ok 0
✅ hook-at-step-started completed 9 0ms ok 0
✅ hook-at-step-completed completed 9 0ms ok 0
✅ hook-at-hook-created completed 9 0ms ok 0
✅ claim-hook-at-registration completed 9 0ms ok 0
✅ claim-hook-at-step-started completed 9 0ms ok 0
✅ deadline-hook-wins completed 6 1.0h ok 0
✅ deadline-expires completed 6 1.0h ok 0
✅ step-vs-timer-early-settlement completed 6 1.0h ok 0
✅ long-sleep completed 9 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 9 2.0s ok 0
✅ parallel-steps completed 7 0ms ok 0
✅ hook-on-execution-state completed 9 0ms ok 0
✅ peek-hook-before-branch completed 9 0ms ok 0
✅ peek-hook-after-branch completed 9 0ms ok 0
✅ peek-hook-at-registration completed 9 0ms ok 0
✅ race-hook-before-probe completed 9 0ms ok 0
✅ race-hook-after-probe completed 9 0ms ok 0
✅ race-duplicate-delivery completed 10 0ms ok 0
✅ attr-hook-before-step completed 9 0ms ok 0
✅ attr-hook-after-step completed 9 0ms ok 0
✅ attr-from-step-body completed 10 0ms ok 0
✅ fork-hook-after-timeout completed 11 1.0m ok 0
✅ fork-hook-before-timeout completed 11 1.0m ok 0
✅ count-hook-after-timeout completed 13 1.0m ok 0
✅ count-hook-before-timeout completed 15 1.0m ok 0
✅ stale-read-step-count-fork completed 15 1.0m ok 0
✅ stale-read-equal-step-counts completed 11 1.0m ok 0
✅ step-vs-step-fork completed 9 0ms ok 0
✅ step-vs-step-fork-fenced completed 9 1.0s ok 0
✅ fence-catches-benign-direction completed 9 1.0s ok 0
✅ run-ahead-fenced-overlap completed 10 1.0s ok 0
✅ in-flight-before-decision completed 15 1.0m ok 0
✅ in-flight-before-decision-counted completed 13 1.0m ok 0
✅ in-flight-after-decision completed 15 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 15 1.0m ok 0
✅ fork-hook-wins completed 10 1.0m ok 0
✅ fork-timeout-wins completed 10 1.0m ok 0
✅ unclaimed-payload-under-fork completed 14 1.0m ok 0
✅ claimed-payload-under-fork completed 14 1.0m ok 0
✅ writers-independent-step-bodies completed 9 0ms ok 0
✅ writers-scripted-tempo completed 9 0ms ok 0
✅ cancel-mid-step cancelled 6 0ms skipped 0

Full trace: world-sim.txt

@github-actions

Copy link
Copy Markdown
Contributor
Framework Flow route Step reg. Framework output
hono 306.6 KiB (±0) 126.1 KiB (±0) 2.42 MiB (±0)
nextjs-turbopack 398.2 KiB (±0) 491 B (±0) 1.14 MiB (±0)
About these numbers

Sizes are gzip; parentheses show the change against main.
Flow route and Step reg. gate this job, on raw bytes rather than the gzip shown, at max(2%, 50.0 KiB). Framework output is informational.

0e52833 · run

@karthikscale3 karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host/origin check only runs in the standalone server.js path. The embedded handler — createWorkflowWebHandler in handler.js — serves the same static + SSR app (including /api/rpc) but never calls checkRequest, so --webAllowedHosts / WORKFLOW_WEB_ALLOWED_HOSTS is silently ignored whenever the dashboard is mounted in-process.

That's a live path, not a theoretical one: @workflow/nitro mounts the dashboard at /_workflow through createWorkflowWebHandler (packages/nitro/src/index.ts:460). So for Nitro/Nuxt users the new option has no effect, and the two entry points behave inconsistently for the same config.

Fix options, either works:

  • Apply the same guard inside createWorkflowWebHandler — wrap the returned handler with checkRequest before the static/SSR dispatch, reading allowedHosts from an option and/or WORKFLOW_WEB_ALLOWED_HOSTS. The host app owns the connection, so this is just an in-handler check, no server wiring.
  • Or, if the embedding host is meant to own request filtering, document that explicitly on handler.js and in the README, and have the integrations pass the setting through. Right now nothing says the embedded path ignores the option, which makes it a silent surprise.

Either way the embedded handler should honor the same config as the standalone server; today it doesn't.

Two smaller things:

  • This is potentially breaking for existing hostname access: anyone reaching the UI via a reverse proxy or a custom hostname starts getting a 403 until they set WORKFLOW_WEB_ALLOWED_HOSTS. Worth a short migration note in the changeset so it isn't a silent behavior change.
  • The no Origin header → allow branch for unsafe methods is intentional (CLI/curl and other non-browser clients), but worth a one-line comment on it so it isn't "tightened" later and quietly breaks those clients.

The rest of the logic reads correctly — the Host parsing (bracketed IPv6, port validation, trailing-dot stripping, fail-closed on malformed input), the full-host (name + port) same-origin comparison, and the unit coverage all look solid.

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — 0e52833f Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants