Read-only demoLive view of gallirohik/research-canvas at 1ebb712, scanned 20 November 2026 — nothing here can be edited.
Join the waitlistlgcDeploymentUrl originates in the browser's own query string
(model-selector-provider.tsx:40 → page.tsx:24), so it is fully
caller-controlled. The route reads it (route.ts:92) and runs
isSafeDeploymentUrl, whose terminal test is addresses.every(addr => !isPrivate…) (route.ts:81) — a deny-private check, not an allow-known one.
The value that passes becomes deploymentUrl on LangGraphAgent alongside
langsmithApiKey (route.ts:122-123), so the LangSmith key rides the
outbound request to whatever public host was named. The only thing in front
of this is isAuthorized, documented in-repo as not access control
(route.ts:22-23).
P1 not P0: LANGSMITH_API_KEY is unset today and there is no deployment
surface in this repo, so the finding is latent. It becomes P0 the moment the
key is set in any network-reachable environment.
The server already knows its legitimate target — LGC_DEPLOYMENT_URL
(route.ts:102) is the fallback used when no ?lgcDeploymentUrl= param is
supplied. Comparing the parsed hostname to that one closes the gap; deny-list
hardening (DNS resolution, private-IP checks) stays as defence-in-depth.
Bundled in the same sitting: unencoded-lgc-deployment-url (open) —
page.tsx:24 interpolates lgcDeploymentUrl into the query string without
encodeURIComponent, so a &/# in the value injects or truncates query
parameters. Same file, same path, named in the P1 row's own fix text.
Ledger: lgc-deployment-url-key-exfiltration (P1, security).
The child task's Done-check passes: the allowlist guard is added alongside the existing checks (nothing removed/weakened), the client-side value is encoded, and typecheck is clean.
lgc-allowlist-fix prism-validated
PASS at build time (validation_tier full) — the exfiltration path is empirically
closed (a public host clearing every pre-existing check is now rejected on
hostname mismatch alone) and the encodeURIComponent fix verified by round-trip.
Epic flipped to status: done; active pointer cleared. Ledger rows
lgc-deployment-url-key-exfiltration and unencoded-lgc-deployment-url reported
fixed.rafa run plan
ladder's audit step hard-blocked on 28 pre-existing, out-of-scope dependency CVEs
(rafa audit exits 1 on any finding by design — unrelated to this fix; already
tracked as next-dependency-cves / next-transitive-postcss-sharp-cves /
copilotkit-runtime-transitive-cves). Recall, bloom's blast-radius pull, and the
security-audit transparency pass were completed via the ladder before it was
abandoned; this plan carries that grounding forward.Allowlist LGC_DEPLOYMENT_URL's host in isSafeDeploymentUrl; encode lgcDeploymentUrl in page.tsx
isSafeDeploymentUrl in src/app/api/copilotkit/route.ts rejects any
lgcDeploymentUrl whose parsed hostname does not case-insensitively equal
LGC_DEPLOYMENT_URL's parsed hostname, in addition to (not replacing) the
existing protocol / localhost/.local / DNS-resolution / private-IP
checks.LGC_DEPLOYMENT_URL is unset or fails to parse, any caller-supplied
lgcDeploymentUrl is rejected with 400 (no known host to allow). Requests
that supply no lgcDeploymentUrl param are unaffected by this change:
deploymentUrl still falls back to LGC_DEPLOYMENT_URL (route.ts:102) and
the runtime selection at route.ts:118 is untouched — when neither is set,
the route continues to serve LangGraphHttpAgent against
REMOTE_ACTION_URL/localhost:8000 (route.ts:93-118). The 400 applies only
to caller-supplied values; rejection and fallback are mutually exclusive,
never both claimed for the same request.src/app/page.tsx's runtimeUrl template wraps lgcDeploymentUrl in
encodeURIComponent(...) before interpolating it into the query string.pnpm exec tsc --noEmit exits 0 with no new errors (baseline is already
clean at HEAD).lgcDeploymentUrl
hostname equals the configured LGC_DEPLOYMENT_URL host still passes
(existing behavior preserved); a request naming a different public https
host that resolves to a public, non-private address — https://example.com
(verified: resolves to public IPv4/IPv6 addresses, clears the protocol /
.local / DNS / private-IP checks, and is therefore accepted by the
pre-fix guard) — is rejected with 400 post-fix solely because its
hostname ≠ LGC_DEPLOYMENT_URL's hostname. (https://attacker.example is
NOT a valid exemplar: .example is RFC 2606 reserved and does not
resolve, so it is already rejected by the existing DNS-resolution catch
regardless of the allowlist.)route.ts: added module-scope allowedDeploymentHost
derived from LGC_DEPLOYMENT_URL (null if unset/unparseable), and
isSafeDeploymentUrl now rejects any hostname that doesn't match it — added
alongside the existing protocol/localhost/DNS/private-IP checks, all untouched.
page.tsx: runtimeUrl wraps lgcDeploymentUrl in encodeURIComponent.
tsc --noEmit exits 0.&/# payloads. Residual (non-blocking, matches Done-check's literal
"hostname" wording, flagged as a follow-up not this task): the allowlist
compares hostname only, not port — a different service on another port of the
same allowed host would still pass. Status → done.