Repository navigation
feat: route preview app hostnames to agent previews - #31283
DanielleMaywood wants to merge 2 commits into
Conversation
ibetitsmike
left a comment
There was a problem hiding this comment.
Adversarial security review — #31283 (preview hostname routing / CORS)
Part of the stack review; the stack-level roll-up (findings S1/S2, method, verified negatives) is on #31282. Line numbers at stack head 678b80103.
Contributes to S1 (P1, contested; validated) — the CORS mitigation is keyed on hostname shape, only withholds response headers, and is skipped for passthru
- Keyed on
preview--slug, not on content provenance.coderd/httpmw/cors.go:126denies only origins whose slug parses as a preview ID.open_preview(port)(#31284) lands the same LLM-authored content on<port>--agent--ws--user, which this function still allows withAllowCredentials: true(cors.go:140) for every app of the same username — including other workspaces. Validated end-to-end through the real proxy:ACAO: <port origin>+ACAC: trueagainstvictim--agent--w2--testuser. - CORS does not block the request.
go-chi/corsalways callsnextfor non-preflight requests; it only withholdsAccess-Control-Allow-*. Validated: a formPOSTwith only the ambientcoder_subdomain_app_session_token_<hash>cookie (Domain=.<wildcard>—proxy.go:277;SameSite=Lax,strictnot selectable —codersdk/deployment.go:3665) andOrigin: https://preview--0123456789abcdef--agent--ws--owner.<wildcard>was token-issued byResolveRequestand delivered to the sibling upstream with its body. There is noOrigin/Sec-Fetch-*/Referergating anywhere incoderd/workspaceapps/*.go. The PR body ("agent-authored pages cannot make credentialed requests to the owner's other apps") and the comment atcors.go:124-125describe a property the code does not have — please reword to "cannot read responses". cors_behavior=passthrubypasses the check entirely.proxy.go:406case codersdk.CORSBehaviorPassthru: next.ServeHTTP(...);ModifyResponseleaves upstream headers intact. Validated: with the template set to passthru and a reflecting upstream,ACAO: http://preview--…+ACAC: truereached the client unchanged; switching back tosimplestripped them. (Voted P3 on its own; it matters because dev servers that reflectOriginare exactly the ones where reads become possible.)- "Previews are always owner-only. Port shares do not apply" (
request.go:327-330) is true only forpathmode; port-mode previews take the port branch (request.go:357-400) and a public share serves the LLM-authored page unauthenticated (validated303→200).
Suggested fix: move the preview-origin rule out of WorkspaceAppCors into an unconditional step in determineCORSBehavior (also strip ACAO/ACAC from passthru responses when Origin is a preview host), and consider a hard 403 in HandleSubdomain when Origin parses as a preview host that is not the request host (closes the CSRF vector for everything that sends Origin, i.e. all cross-origin POST/PUT/PATCH/DELETE and no-cors fetches). Coordinate with #31284 so port-mode previews also get a preview---class slug (e.g. preview--p<port>--…), otherwise the origin check cannot distinguish them.
Contributes to S2 (P2; validated) — "owner-only" means application_connect
appSharingLevel = Owner (request.go:330) resolves to Authorize(ActionApplicationConnect, workspace) at db.go:370. Validated principals that pass for another user's workspace: site owner role (unless --disable-owner-workspace-access), workspace-ACL use/admin, and premium custom org roles granting workspace.application_connect (which can be granted without ssh). Org admins and same-org members are correctly denied. Nothing new is exposed to SSH-capable principals, but the wording in the PR body and request.go:327 is inaccurate. If literal owner-only is intended, add dbReq.Workspace.OwnerID.String() != roles.ID → deny for isPreview in authorizeRequest, analogous to the path-app owner check at db.go:328-339.
Unverified (single reviewer) — P3 / nit
- nit Path-based
/@owner/<ws>.<agent>/apps/preview--<id>/returns500after the workspace lookup but before authz (existence/state oracle for any authenticated user). Same pre-existing pattern as port slugs (request.go:337-340TODO); cheap to fix by checkingAccessMethodbefore the DB lookups. - nit Preview accesses are connection-logged as
port_forwardingwithslug_or_port = preview--<id>(db.go:478-486); acknowledged in the PR body, but auditors filtering on port forwarding will see preview traffic mixed in.
Verified negatives (no action)
- Hostname parsing regression: a 104,868-hostname corpus (2–6 segments over
{preview, <16hex>, PREVIEW, 8080, 8080s, 0005, 00005, …}with/withoutp---prefix) parsed with the pre-PR and new parsers → zero meaning changes; only 5-segmentpreview--<16hex>--agent--ws--usershapes newly parse.preview--<16hex>--ws--userkeeps its old meaning. Mixed-case → 400.X-Forwarded-Hosthonoured only from trusted origins. coder_appslugs can never contain--(provisioner.AppSlugRegex, enforced on every insert path), soisPreviewis never true for a DB app; reserved-port exception is sound (isPreviewfrom hostname,AppURLonlyhttp://127.0.0.1:5/<id>for preview slugs,MatchesRequestbinds slug/agent/prefix, signed-token cookie is host-only, terminal/path access can't reachproxyWorkspaceAppwith a preview).- Leading-zero ports
0005/00005/0005s/0004passPortRegexand get a token (even anonymously with a DB-injected public share) but still hit400 Coder reserves ports…— pre-existing, unchanged. - Traversal to the agent (
/../x,/%2e%2e/x,//x,/\x,/;x,?coder_signed_app_token=) all end at the agent's 404; Coder cookies stripped before proxying; smuggling redirect is same-origin.
0528b71 to
b4c1433
Compare
b4c1433 to
b2de574
Compare
b2de574 to
b78fe61
Compare
DanielleMaywood
left a comment
There was a problem hiding this comment.
This review was performed by ai-review, an automated review bot.
1 inline finding.
Coverage
Coverage: 6 of 6 files reviewed; 22 rules.
Candidates: 136 found, 121 outside changed lines, 0 already discussed, 15 evaluated.
Findings: 1 (2 sites, 0 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 15 questions, 15 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 15881 input and 4725 output tokens.
b78fe61 to
ae91195
Compare
ae91195 to
bd769f9
Compare
bd769f9 to
00465e4
Compare
ibetitsmike
left a comment
There was a problem hiding this comment.
Follow-up (re-checked at 2c52e96): the new isFromOtherPreview gate has three bypasses — P2, validated
First: the rebase addressed the substance of my earlier S1 — preview--<port> slugs, hard 403 on preview Origin, CSP sandbox, Origin check ahead of cors_behavior. Thanks. Re-testing the new gate end-to-end (real coderd + agent + Postgres, upstream records every delivered request) shows it is still bypassable in three ways. (a) and (b) were also flagged by a second, independent review of the rebased stack; (c) surfaced while comparing the two.
| case | request | proxy | upstream |
|---|---|---|---|
| (c) path app | POST /@owner/ws.agent/apps/pathapp/do, Origin: http://preview--0123…--agent--ws--owner.<wildcard>, only coder_session_token |
200 | POST /do body="a=1" |
| control | same POST to <port>--agent--ws--owner.<wildcard>/do with the subdomain cookie |
403 "Preview pages cannot send requests to other apps." | none |
(a) no Origin |
subdomain POST /do / GET /img.png, no Origin header |
200 | delivered |
(b) Origin: null |
subdomain POST /do, Origin: null |
200 | POST /do Origin="null" body="a=1" |
| control | Origin: …preview--0123456789abcdef… and …preview--8080… |
403 | none |
Why:
isFromOtherPreview(coderd/workspaceapps/proxy.go:545-547) returnsfalse(= allow) whenorigin.Host == "". A missing header and the literalnullboth parse to an empty host (url.Parse("null")→Host="",Path="null"). Browsers omitOriginon no-corsGETs (<img>,<script>,<iframe>,<link>), and emitOrigin: nullfrom a nested<iframe sandbox>withoutallow-same-origin— which the preview page can create itself — or after ano-referrerpolicy on a form POST. So an agent-authored page can still make the browser deliver authenticated GETs andnull-origin POSTs to every app the viewer can reach, with the ambientDomain=<wildcard>cookie. Responses stay opaque (no-cors), so this is blind CSRF/resource loading, not a read primitive.- The check is only called from
HandleSubdomain(proxy.go:494).workspaceAppsProxyPath(proxy.go:317) never looks atOrigin; path apps authenticate viacoder_path_app_session_tokenfalling back to the fullcoder_session_token(cookies.go:84-93); and the CSRF middleware exempts everything outside/apiand/oauth2/authorize(httpmw/csrf.go:71-73). The preview origin is same-site with the dashboard in a typical deployment, soSameSite=Laxdoes not withhold that cookie on a form POST. A well-formed previewOriginis forwarded verbatim and the request is served. Path apps are enabled by default. This is pre-existing for any same-site page, but the docs now say "Coder rejects cross-origin requests from a preview page to other workspace apps, such as form posts andfetchcalls" (#31287), which this falsifies.
Suggested fixes:
- Apply the same gate in
workspaceAppsProxyPath(and the terminal path if applicable). - For subdomain and path apps, fail closed on unsafe methods when
Originis absent ornull:Sec-Fetch-Site/Sec-Fetch-Mode/Sec-Fetch-Destare sent by all evergreen browsers and let you rejectsame-site+navigate|no-corsinitiations from a preview without breaking first-party navigations (Sec-Fetch-Site: none). NoteSec-Fetch-*cannot name the initiating host, so this is defence in depth. - The structural fix is still credential scoping: previews on a separate site, or a preview-specific host-only cookie, so the wildcard app cookie is never ambient on a preview page. With the current design the
Origin/Fetch-Metadata gate can only ever be best-effort. - Reword the docs/PR claim to what is enforced (see #31287).
Service worker on the stable preview origin can observe the app-auth handoff — P2, mechanism verified, browser-unverified (credit: second independent review)
- Preview responses get only
Content-Security-Policy: sandbox allow-scripts allow-same-origin …(proxy.go:724); thesandboxdirective does not restrict workers and there is noworker-src/default-src, and the agent serves.jsfrom the published tree with the correct type. A prompt-injected page can therefore register a service worker scoped to its origin, which is stable (preview--<sha256(path)[:8]>…andpreview--<port>…). - On a later cookie-less visit (expiry, new browser profile,
--disable-…rotation) the proxy redirects through/api/v2/applications/auth-redirectand lands back on the preview host with?coder_application_connect_api_key_35e783=<JWE>(proxy.go:43,209). A controlling worker sees that navigation URL beforehandleAPIKeySmugglingstrips it (proxy.go:308). The JWE has a 1-minute expiry (token.go:61) but no one-time-use and no binding to the target host (audience is the genericwsproxy,token.go:60,71), so it is replayable from another browser within the window to mint the viewer'sapplication_connectcookie. Workers also persist across the daemon restart that invalidates the publication. - Fixes: add
worker-src 'none'(a separate CSP header; the sandbox directive won't do it) and considerClear-Site-Data: "storage"on preview 404s; make the smuggled payload single-use and bound to the exact redirect host; salt the preview ID per agent process (#31282) so the origin is not stable across restarts.
I can share the validation test source if useful.
00465e4 to
3b09300
Compare
|
@codex review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b09300be0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3037b2b to
331f425
Compare
DanielleMaywood
left a comment
There was a problem hiding this comment.
This review was performed by ai-review, an automated review bot.
1 inline finding.
Coverage
Coverage: 6 of 6 files reviewed; 53 rules.
Candidates: 323 found, 265 outside changed lines, 6 already discussed, 52 evaluated.
Findings: 2 (2 sites, 0 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 52 questions, 48 answered, 4 abstained (unsure 1, truncated 3), 18 cached; 0 uncalibrated findings held back; 46763 input and 78442 output tokens.
331f425 to
9e79cb8
Compare
9e79cb8 to
1923f51
Compare
dfb4b45 to
0380d38
Compare
0380d38 to
f5aa92e
Compare
f5aa92e to
2ff8731
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.13.0 | Round 5 | Last posted: Round 5, 34 findings (1 P1, 3 P2, 14 P3, 12 P4, 4 Nit), APPROVE. Review Finding inventoryFindings
Contested and acknowledgedCRF-1 (P3, appurl.go:195) - IsPreviewHostname over-matches a suffixed four-part app host
CRF-7 (P2, request.go:322) - Separate preview-- host
CRF-13 (P4, db_test.go:780) - Port shares on the shared test workspace
CRF-22 (Nit, appurl.go:151) - IsPreviewID doc says "static preview"
CRF-26 (P4, proxy.go:526) - Known limitations omit older-proxy Origin check gap
CRF-21 (P4, proxy.go:632) - Repeated untrusted-agent rationale; request.go:318 copy
CRF-35 (P3, proxy.go:850) - 103 Early Hints skip ModifyResponse
CRF-36 (P3, proxy.go:600) - isRepostToOtherHost decides no outcome
CRF-38 (P3, request.go:322) - Port previews HTTP only
CRF-37 (P3, appurl.go:164) - PreviewMinimumPort doc and the 1000 floor
Law analysisNot run. Effective additions 733 (threshold 1000). Head 2209295. Round logRound 1Round type: round 1, full panel. Netero first pass: 1 P3, 2 P4, 1 Note, 1 OOS; no P0, panel proceeded. Panel (13): ging-go, kurapika, ryosuke, melody, luffy (specialists); pariston, mafuuu (core); bisky, hisoka, gon, leorio, kite (pool); zoro (wildcard, random from distilled set). Size target 9-12 for security-sensitive code plus wildcard. Cross-check decisions:
Reviewed against 58fb989..2209295. Round 2Round type: fix round. All changes since round 1 respond to findings; the added Cross-check decisions:
Reviewed against 57dfcfb..886faee. Round 3Round type: fix round. Changes since round 2 address CRF-21, 22, 32, 33, 34, 37 and add a Cross-check decisions:
Reviewed against 2d9f1f6..96a0777. Round 4Round type: fix round. Range-diff 96a0777..be60b96 changes only the CRF-42 comment deletion, the CRF-45 Round 5Round type: fix round with no fixes; pure rebase. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
This PR routes preview--<id> and preview--<port> app hostnames to agent file previews and ports, and adds a CSP, an Origin check, a repost check, a service-worker block and chat-header stripping for those hosts. Findings: 1 P1, 2 P2, 9 P3, 9 P4, 3 Nit.
The failed Flake Check was cancelled by workflow concurrency ("Canceling since a higher priority waiting request ... exists"), not by a test failure.
Out of scope (needs a ticket or explicit acceptance by a human):
coderd/workspaceapps/request.go:336: path-based port slugs return 500 instead of 400 (existing TODO), so client errors are logged as server warnings.coderd/workspaceapps/proxy.go:291: the subdomain app session cookie is scoped to the whole app wildcard, so a page on any app or port host can send credentialed requests to the user's other apps.coderd/httpmw/apikey.go:1030: the session cookie has no__Host-prefix and token extraction takes the firstcoder_session_token, so a page on any subdomain app host can shadow the dashboard session.coderd/httpmw/cors.go:124:WorkspaceAppCorsallows credentialed CORS reads from any port-forward origin of the same owner, including other workspaces.coderd/tailnet.go:227:ServerTailnet.ReverseProxyuses the deprecatedReverseProxy.Director, whose headers a client can strip throughConnection.coderd/workspaceapps/proxy.go:835: non-preview apps and port forwards passClear-Site-Dataand parent-domainSet-Cookiethrough, so any workspace server the user opens can clear or set cookies for the registrable domain.
Notes:
coderd/workspaceapps/appurl/appurl.go:153:IsPreviewIDhas no caller outsideappurluntil #31285.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 2 of the review of preview hostname routing at 886faee35f. New: 1 P2, 5 P3, 1 P4. Re-raised: one P4 and one Nit.
Addressed and verified: the 500 for path-based preview slugs, the ancestor chat-header test, Clear-Site-Data on previews, the --- suffix origin miss, the 502 for blocked reposts, the passthru test gap, the token-derived preview rules, the previewPolicy, chat-header and commit-message wording, the isPreviewPort rename, the port-bound constant, the ID-width test link, and the three nits. The four contested findings on the -- suffix over-match, the separate preview--<port> host, the shared test port shares, and the older-proxy limitation are closed: each reviewer that raised one accepted the defense. Two findings are re-raised on their threads: the IsPreviewID doc still says "static", and two copies of the untrusted-agent rationale remain.
The self-navigation P1 is closed by disclosure plus the #31286 wrapper frame. A preview opened directly by its URL can still reach the owner's other apps, and the decision log calls a separate registrable domain "the stronger follow-up" without a ticket. This needs a human decision: file a ticket or explicitly accept the gap.
The failing title check is the PR title scope finding below; 19 of the other failing jobs were cancelled by workflow concurrency.
Out of scope (needs a ticket or explicit acceptance by a human):
coderd/tracing/status_writer.go:58:StatusWriterrecords the first status passed toWriteHeader, so request logs and metrics for any proxied app that sends a 1xx show 103, not the final status.coderd/x/chatd/chattool/openpreview.go(#31284): theopen_previewtool description does not tell the model that port previews cannot load CDN assets or call other origins, so the model opens previews that render broken without a way to tell why.
🤖 This review was automatically generated with Coder Agents.
|
Decisions on the body items, all made by @DanielleMaywood: the top-level self-navigation gap when a preview is opened directly by its URL is accepted without a ticket, and a separate registrable domain stays a possible follow-up.
|
|
/coder-agents-review |
There was a problem hiding this comment.
Round 3 of the review of preview hostname routing at 96a07777d1. New: 2 P4 and 1 Nit. Re-raised: one P4.
Addressed and verified: the Set-Cookie filter bypass (hasDomainAttribute drops every line with a domain attribute, and every case where it differs from browser parsing drops more lines, never fewer), the IsPreviewID doc, the title scope (a later title run on this head passed), and the iframe reference in ModifyResponse. The four contested findings (103 Early Hints, the repost check, HTTP-only port previews, and the request.go:318 rationale) are closed: each reviewer that raised one accepted the defense. The new coder_preview_sign_in branch runs after the Origin check and token resolution, and the parameter survives the API key redirect.
Out of scope (needs a ticket or explicit acceptance by a human):
- #31287 docs and the #31284
open_previewportdescription: no user-facing text says port previews connect over plain HTTP, so a user who previews an HTTPS dev server gets a 502 or the server's own 400 with no explanation.
🤖 This review was automatically generated with Coder Agents.
|
On the out-of-scope item in the review body (port previews are HTTP only): fixed. The
|
|
/coder-agents-review |
There was a problem hiding this comment.
Round 4 of the review of preview hostname routing at be60b96f0c. No new findings, and no findings remain open.
This round verified the fixes to the sign-in comment, the lowercase domain test line (making the attribute match case-sensitive now fails TestHandleSubdomain), and strings.SplitSeq in hasDomainAttribute. The PreviewMinimumPort finding is closed: the reviewer that raised it accepted 1000 as a product bound that #31284 publishes and enforces, with reserved-port safety enforced independently by the leading-zero rejection and the AgentMinimumListeningPort check.
The human decisions in the PR conversation are recorded: the self-navigation gap for a preview opened directly by its URL is accepted without a ticket, and the StatusWriter 1xx and open_preview CDN-limit items are accepted. The HTTP-only port preview item is reported fixed in #31284, #31484 and #31287.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 5 of the review of preview hostname routing at caf373e385. No new findings, and no findings remain open.
The commit is patch-identical to round 4 (git range-diff prints be60b96f0c = caf373e385), and the base commit from #31282 is also unchanged. The six new main commits do not touch any code on this PR's request paths, and the coderd/workspaceapps, appurl and agentpreview tests pass on the new base.
🤖 This review was automatically generated with Coder Agents.
Subdomain app hostnames shaped preview--<id>--<agent>--<workspace>--<owner> proxy to http://127.0.0.1:4/api/v0/previews/<id>, the agent API route that serves published files, and preview--<port>--... proxy to that port. The double hyphen keeps them disjoint from coder_app slugs, which cannot contain one, so no existing app URL changes meaning. Previews use the owner sharing level, so only users who can connect to the workspace's apps can open them, and port shares do not apply. Previews are subdomain-only, and only file preview hostnames may reach the agent API's reserved port. Preview responses carry a sandbox and a CSP that keep every request on the preview's own host, drop Clear-Site-Data and cookies with a Domain attribute, and refuse redirects that resend form data to other hosts. App requests whose Origin is another preview are rejected. A preview page can still navigate itself to another app, so whatever embeds a preview must prevent that with frame-src. A preview request with the coder_preview_sign_in query parameter gets an empty page from coderd once the browser is signed in to apps, and never reaches the preview. An embedder whose frame-src blocks the sign-in redirects can load it in a hidden frame first, without the preview's server answering that frame.
Preview requests keep the same origin protections as other subdomain apps: WorkspaceAppCors and the app's own hostname. The proxy no longer refuses requests whose Origin is another preview host, so the removed isFromOtherPreview check and IsPreviewHostname helper are gone with it. Generated by Coder Agents on behalf of @DanielleMaywood.
Removed the preview-origin request refusal, per review feedback. Requests from preview pages now get the same origin protections as any other subdomain app: the usual |
Subdomain app hostnames shaped
preview--<id>--<agent>--<workspace>--<owner>now proxy tohttp://127.0.0.1:4/api/v0/previews/<id>on the agent, andpreview--<port>--…proxy to that port. Previews are subdomain-only, use theownersharing level (application_connecton the workspace) and ignore port shares. Only file previews may reach a reserved port, and only the agent API. Because preview pages are agent-authored:Content-Security-Policy: sandbox allow-scripts allow-same-origin allow-forms allow-modals allow-downloads; default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; frame-src 'self'; object-src 'none'; form-action 'self'. The page can't navigate the top-level page, open popups, or load or send anything (scripts, images, frames,fetch, WebSocket, forms) from or to another host.Clear-Site-Dataand anySet-Cookiewith aDomainattribute (matched on the raw header, case-insensitively and with spaces around the name), so a preview server can't log the user out of the registrable domain or set cookies on the owner's other apps.403.coder_preview_sign_inquery parameter gets an empty200from coderd once the browser is signed in, and never reaches the preview. The dashboard loads it in a hidden frame so the sign-in redirects, which the wrapper'sframe-srcblocks, finish before the preview is shown, without the preview's server answering that frame.frame-src <preview origin>. A preview opened directly by its URL can navigate to the owner's other apps.Decision log
coder_appslugs cannot contain--, so the five-part preview hostname cannot collide with any existing app or port URL. A single-hyphenpreview-<id>slug would have shadowed (and broken) acoder_appwith that slug. The preview pattern is matched first and requires the agent name; every hostname that parsed before parses the same way.preview--<port>host. Previews are alwaysownersharing level, even if a port share exists for the agent API port or for the previewed port. Port previews get their own hostname rather than reusing the port-forward hostname, so the preview CSP applies to them. Preview ports start atappurl.PreviewMinimumPort(1000) and have no leading zeros, sopreview--0005cannot name a reserved port.Coder-Chat-IdandCoder-Tool-Call-Id, so the proxy drops those headers (andCoder-Ancestor-Chat-Ids) on file-preview requests. Otherwise a preview page could fill that store or answer in place of a real tool call.default-src 'self'. Without it,<img>and<script>GETs reach other apps with the user's app cookie (confirmed in Chromium, Firefox and WebKit). Cost: previews can't load assets from a CDN or call external APIs from the browser.form-action 'self'blocks it in Chromium, but Firefox appliesform-actiononly to a form's first URL, so the proxy refuses those redirects itself.application_connect, not literal owner. Users the workspace is shared with, and site owners unless--disable-owner-workspace-accessis set, can view previews, the same as other owner-level apps.document.cookie, which is why the docs recommend--host-prefix-cookie.preview--, an 8-character ID and the separators) before names, so long agent, workspace and owner names can exceed it, as they already can forcoder_appslugs.Stack (proof of concept for the embedded previews RFC, review bottom-up):
coder_apptabsopen-previewexperiment