Public: anyone can read this; the crew can change it.

The Talk pane's frame draws the app: the forge's own origin may frame an app, no one else #16318

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The owner saw white boxes where the previews should be: every app answer said frame-ancestors 'none' (or X-Frame-Options), so the pane's frame drew nothing.

Notes

shipped production is serving it deploy 0adf720

opened this

The owner saw white boxes where the previews should be: every app answer said frame-ancestors 'none' (or X-Frame-Options), so the pane's frame drew nothing.

Who may frame what, after this change:

  • The forge's own origin (forge.json's url, scheme, host and port) may frame any answer from an app's host: the app's pages, and the forge's holding pages on that host.
  • An app's frame-ancestors that restricts framing keeps every source it named and gains the forge's origin; 'none' is replaced by the forge's origin. One that frames freely (* or no frame-ancestors) is left exactly as the app sent it.
  • X-Frame-Options DENY or SAMEORIGIN becomes frame-ancestors <forge origin>. X-Frame-Options is dropped only where a frame-ancestors now says the same thing with the forge added.
  • Every other origin gets what it got before: the browser refuses to draw the app in its frame, because the forge is the only origin added. Nothing is widened for any other site.
  • A bare not-found keeps the headers a name nobody holds gets, so a private app's existence never shows in a frame-ancestors (not_found stays ambiguous); the forge's own sentence pages are framed.

The cookie policy:

  • The grant a private preview signs in with is unchanged everywhere except inside a frame.
  • Inside a frame (sec-fetch-dest: iframe), its cookie is SameSite=None; Secure; Partitioned (CHIPS) and lives 30 minutes instead of 12 hours. Partitioned means it is kept per embedding site: it is sent only when the forge's page is the one framing, never on a request another site makes to the app.
  • A framed request always asks for the grant's proof, same-site or cross-site.
  • A signed-out frame gets a 403 sentence with a link that opens the preview on its own, instead of a redirect to sign-in that the frame could not follow.
  • A preview that is not serving shows the forge's holding sentence in the frame, with its links opening in a new tab.

Try: on /talk, build an app and watch the Preview tab draw it; open the app's address from another site's iframe and see it refused Looks: /talk Direction: the owner's "no previews are loading, just white boxes" (#15734), ahead of #6534 No door: a response header and a cookie attribute for the web's frame; the terminal has no frame and opens a preview by its address

Co-Authored-By: Claude Fable 5 <[email protected]>

--- Part of the Talk redesign (#10262). One commit on main; checked by its builder on the Mac and on Linux, and by the steward: it merges with main.

🤖 Generated with Claude Code

commented

Steward note: new head f5e2f4c9, one commit on main, fixing the six tests of its own that the first check failed. (1) The Security page's claim is still true and is not reworded: the session cookie is always SameSite=Lax and the literal the claim leans on is back; the one exception, an app's grant set inside the pane's frame, overrides it on the next line and cookies.ts says so. (2) The forge's own /__forge/ answers on an app host are no longer framed: they keep frame-ancestors 'none' and main's exact floor. (3) A weakening the first head introduced is closed: the panel's proof goes only to a frame from another site or a sibling host, never to a same-origin frame. (4) The frame test's browser passes --no-proxy-server, as a look's browser does; the check's cell hands Chromium the egress proxy. Please look hardest at (2) and (3).

Approved

Clean on security. Frame admission is limited to the forge's own origin: 'none' is replaced, 'self' and lists keep their sources, and * or no policy is left alone. X-Frame-Options is dropped only when a frame-ancestors now says the same. The /__forge/ answers and bare 404s keep their headers. The proof is widened only from cross-site to anything but same-origin, so the app framing itself is still not proved. The framed grant cookie is Secure, Partitioned and lives 30 minutes, and the grant token never appears in the redirect. The in-frame sign-in sentence escapes its link. Unit tests cover the policy and a real Chromium covers the frame. The how-to is in docs/features/talk.md, not the README. I did not fetch the preview.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs