Repository navigation
fix(server): other sites can no longer frame the web app - #36395
Conversation
The static SPA handler sent no anti-framing headers, so a page that shares the session cookie's site could frame the app and steer a click onto a one-click action such as approving an agent sign-in on /connect-agent. HTML responses now send `Content-Security-Policy: frame-ancestors 'none'` and `X-Frame-Options: DENY`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval โ HTML responses will block all framing, reducing clickjacking exposure but also preventing legitimate embedding. Human confirmation is needed that this default restriction, including same-origin framing, is intended. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impactโ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
* fix(server): Claude can show the user mid-turn text in full (pingdotgg#36384) * fix(cli): tagged source builds report the release version (pingdotgg#36350) Co-authored-by: Lakshmi Tanmay <lakshmi@voltcrash.com> * fix(server): storage cleanup prunes idle No project folders under ~/.t3/scratch (pingdotgg#36369) * fix(terminal): trimmed history no longer replays half of a control sequence (pingdotgg#36368) * fix(usage): a re-emitted Codex snapshot is no longer billed as a counter rewind (pingdotgg#36367) Co-authored-by: rihanaws <rihanawsacc@gmail.com> * fix(server): a Claude Monitor line no longer wakes a delegated child's parent (pingdotgg#36339) * fix(opencode): a lost subagent report no longer leaves a resumed call running (pingdotgg#36386) * fix(web): a new worktree thread opened during a clone bases on the real default branch (pingdotgg#36379) * fix(server): unauthenticated token requests no longer write DPoP replay markers (pingdotgg#36393) * fix(server): other sites can no longer frame the web app (pingdotgg#36395) * fix(server): a server browser tab survives a renderer crash, and a service worker badge call no longer causes one (pingdotgg#36389) * fix(web): T3 Connect sign-in offers Retry after Clerk fails to load (pingdotgg#23620) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): macOS PR previews no longer run the PR's bundle next to signing secrets (pingdotgg#36407) * fix(mobile): a new thread's first message no longer returns to the composer after a lost launch reply (pingdotgg#32330) * fix(web): size markdown media whose width and height carry a px unit (pingdotgg#32108) * fix(web): file links the agent cited from a checkout it cd'd into open that file (pingdotgg#36364) * ci(mobile): iOS jobs run on macos-27, store builds require the final Xcode 27.1 (pingdotgg#36421) * fix(server): Claude context meter no longer shows an auto-compact point when auto-compaction is off (pingdotgg#36417) * fix(web): a run waiting on foreground subagents says so instead of Thinking (pingdotgg#36334) * fix(server): a follow-up to a delegated child waits for its awaited background work (pingdotgg#36411) * fix(provider-grok): Grok follow-ups queue instead of cancelling the running tool (pingdotgg#36422) * fix(server): thread list builds metadata only for the page it returns (pingdotgg#36434) * fix(web): middle-clicking empty chat space on Linux no longer pastes into the composer (pingdotgg#36436) * fix(web): closing Settings no longer leaves it as a back/forward stop (pingdotgg#36437) * fix(opencode): OpenCode 1.x threads report context-window usage (pingdotgg#36430) * fix(web): bare @ in the composer lists workspace files (pingdotgg#36435) * fix(mobile): thread list project filter lists recently active projects first (pingdotgg#36433) * fix(clients): live working timers count on the host's clock (pingdotgg#36420) * perf(relay): lighter Postgres load and PS-160 cluster (pingdotgg#36442) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(mobile): mobile:install --session works on pooled devices (pingdotgg#36447) * fix(native): KDE SnapShot no longer loses the first reply from KWin (pingdotgg#36218) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> * fix(server): t3 connect status no longer reports a publish-only link as exposed (pingdotgg#33967) * fix(web): don't label Windows paths outside the workspace as relative (pingdotgg#28469) Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(server): multi-line guest messages are no longer refused or stored with CRLF (pingdotgg#26542) * perf(desktop): provider checks no longer compete with server startup (pingdotgg#35712) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(web,mobile): explain missing file access for host videos (pingdotgg#24637) * fix(scripts): iOS scenarios prepare the dev client before leasing a device (pingdotgg#36456) * perf(server): a new thread's first turn starts sooner (pingdotgg#35710) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(provider-pi): running shell output no longer stores a snapshot row per update (pingdotgg#36429) * fix(web): NVDA browse mode reads the current thread's branch, not the previous one (pingdotgg#34446) Co-authored-by: nibarAhmed <nibarahmed0@gmail.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(server): T3 Connect clients are named "T3 Connect", not "T3 Connect connect" (pingdotgg#27887) * fix(web): screen readers read the Update everything machine list as a table (pingdotgg#36445) * feat: agents can restyle T3 Code with theme colors and CSS (pingdotgg#35247) Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> * fix(mobile): long-pressed iOS blockquotes no longer draw over the thread (pingdotgg#36461) * fix(cli): npm launcher no longer leaves a runtime running after a stop signal (pingdotgg#30487) * feat(connect): require approval for new T3 Connect devices (pingdotgg#36419) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(server): run the Azure CLI in UTF-8 on Windows (pingdotgg#25801) Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(server): preview navigation leaves a page whose script never yields (pingdotgg#36365) * fix(server): the auto-settle sweep no longer rereads every idle branch every few minutes (pingdotgg#36371) * fix(web): rewind no longer offers file restore in project-folder threads (pingdotgg#36467) * fix(server): stop the relay client a crashed server left running (pingdotgg#36465) * fix(server): read Azure DevOps pull request templates (pingdotgg#22881) * perf(azure-devops): PR Code tab loads a page's files in one az run instead of two per file (pingdotgg#35295) Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(web): copying a file preview selection returns the selected lines after scrolling (pingdotgg#36466) * fix(mobile): push-token failures no longer report notifications as enabled (pingdotgg#26557) * fix(provider-core): mise updates a tool configured by its backend name (pingdotgg#36472) * fix(server): parent turns no longer duplicate delegated task thread items (pingdotgg#36473) * fix(server): Windows drive paths open under WSL (pingdotgg#26030) * fix(client-runtime): new T3 Connect machines appear without signing in again (pingdotgg#29788) * fix(azure-devops): local pull request checkout no longer fails on --detect (pingdotgg#31170) Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(usage): count shared Windows and WSL transcripts once (pingdotgg#24319) * fix(azure-devops): pull requests report build validation as checks (pingdotgg#31146) Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com> * fix(desktop): WSL backend starts in distros without automounted drives (pingdotgg#25734) * fix(server): t3 browser setup reloads an AppArmor profile that is on disk but not loaded (pingdotgg#36490) * Initial plan * fix(azure-devops): finish reconciling nightly diff tests Remove retired files-diff code and update mocks for iteration changes and blob reads. Preserve bounded paging, cache, and error-path coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Lakshmi Tanmay <lakshmi@voltcrash.com> Co-authored-by: rihanaws <rihanawsacc@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: ValeraZSD <48602572+ValeraZSD@users.noreply.github.com> Co-authored-by: nibarAhmed <61316519+nibarAhmed@users.noreply.github.com> Co-authored-by: nibarAhmed <nibarahmed0@gmail.com> Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Pedro Henrique <phsilva.sebastiao@gmail.com> Co-authored-by: Kieren-Foenander <68266113+Kieren-Foenander@users.noreply.github.com> Co-authored-by: Pavel Kroupa <63880977+Tabonx@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Alex Vallone <alexvallone@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merges `pingdotgg/t3code` `37714a8de5` (231 commits from `bedc8658c3`) into the fork. Tracker entry: `docs/fork/upstream-merge-log.md` ยง 2026-11-14. ## Merge - Landed 854 files against 853 in the upstream range (the extra is `docs/fork/inventory.json`). Fork delta 772 files. - 5 conflicts, each resolved by its preflight verdict: `AGENTS.md` (decide: fork shape plus upstream's provider list), `agentContextBudget.json` (upstream + the fork's 108 bytes = 49914), `ThreadTerminalDrawer.tsx` (upstream's `resolveTerminalLinkTarget` kept behind the `FEATURES.openInEditor` return), `vite.config.ts` (upstream's `configuredAppVersion` inside the fork's `defineConfig`), `FilePreviewPanel.browser.test.tsx` (upstream's variable plus the fork's `onRetargetFile`). - Lockfile re-derived from upstream's copy. - `duplicate-adds`, `resolution-check`, `inventory-check` and `tripwires` are clean. `apps/mobile/src/state/use-terminal-session.ts` joined the `terminal-metadata-state` entry. - Union: ADD `pullRequests.subscribeLinkedThreadRefreshes` applied; no DROP. - Upstream's new provider-row edge-click test (pingdotgg#32537) needed `FEATURES.providerConfiguration` turned on, because it clicks an unconfigured row the fork hides. ## Verification Format, lint, types, build, lockfile and every merge check pass. Tests: the provider-opencode and t3 failures are the sandbox gaps already in `docs/fork/gaps.md` (`/tmp` sticky bit, git `insteadOf`, OpenCode process groups, Node 24), plus the server-browser and Antigravity installation tests. The only one of those files in the fork delta is `GitVcsDriverCore.test.ts`, and it fails on `insteadOf`. Web was run against a fetched Chromium 1248, because the image ships 1254: 620 of 624 files passed, three passed when run alone, and the fourth is fixed here. ## Upstream features ### Usable as-is - Client fixes across chat, composer, terminal links, file preview, settings and accessibility (e.g. pingdotgg#36497, pingdotgg#34964, pingdotgg#36466, pingdotgg#36435, pingdotgg#36174, pingdotgg#36380, pingdotgg#36363, pingdotgg#36437). - Theme CSS editor in Settings โ Appearance (pingdotgg#35247), on the client side. It shows only where the server reports `environmentThemes`. ### Unsupported in Moatless / needs implementation - `pullRequests.subscribeLinkedThreadRefreshes` and the `linkedThreadRefreshes` capability (pingdotgg#35865). Without them the client polls `pullRequests.linkedThreads` every 10s. Now refused through `UnsupportedMethodError`. Recorded in gaps under methods not dispatched and capabilities. - T3 Connect device approval (pingdotgg#36419). This is a decided-out surface. - Agent theme MCP tools (pingdotgg#35247), which write `css` into environment themes. ### Backend behavior to consider reproducing in Moatless - `ServerConfig.serverTime` so live timers count against the host clock (pingdotgg#36420). - A thread list that builds metadata only for its page (pingdotgg#36434), and a thread visit that stores only read state (pingdotgg#36233). - An auto-settle sweep that stops rereading idle branches (pingdotgg#36371). - `frame-ancestors`: other sites can no longer frame the web app (pingdotgg#36395). - A send to an unrecoverable worktree fails instead of reporting started (pingdotgg#36251), and turns recreate a lost worktree checkout (pingdotgg#34894). - Scheduled deliveries follow the thread's current model (pingdotgg#34149). - Delegated children wait for awaited background work and subagents (pingdotgg#36411, pingdotgg#34958). - Fetched upstream commits are no longer shown as agent changes (pingdotgg#36332), and turn diffs follow branch switches (pingdotgg#36343). All are listed under "Runtime fixes upstream made to its own server" in `docs/fork/gaps.md`. ## After merging - `moat gh workflow disable issue-vouch.yml -R soaplabs/t3code` (new upstream workflow that arrives enabled). ๐ค Generated with [Claude Code](https://claude.com/claude-code) --- Moatless task: https://moatless.soaplabstest.com/tasks/c89558cd-26c7-4a4c-a68f-04675720d7b7
## Human comments ## What was wrong No response that serves the bb web app set `frame-ancestors` or `X-Frame-Options`. `registerStaticAppRoutes`/`serveAppShell` in `apps/server/src/server.ts` sent only cache headers, and Connect passes origin headers through unchanged, so `<label>.getbb.app` could be framed too. The Connect session cookie is `Domain=.getbb.app; SameSite=Lax` (`apps/connect/src/desktop-session.ts`), and share links (`<label>--<port>.getbb.app`) serve arbitrary local servers. Those pages are same-site with the app, so the cookie goes with a framed request, and a share page could frame a signed-in bb and steer clicks into it. getbb.app has the same problem: `/link` (approve a bb sign-in), `/dashboard` and every other page except `/oauth/authorize` could be framed from a share link (checked with `curl -D -` against production). Credit: found by auditing T3 Code's fix for the same bug, pingdotgg/t3code#36395. ## What changed - **Server** (`apps/server/src/server.ts`): the app shell sends `Content-Security-Policy: frame-ancestors 'none'` and `X-Frame-Options: DENY` on 200 and on 304 revalidations, for `/`, `/index.html` and every SPA fallback path. Assets, file previews and API routes are unchanged. - **Connect** (`apps/connect`, `apps/connect-next`): no code change. Both already forward origin headers and store them with the cached shell. The shell-cache tests now assert that the headers survive the cache-miss, served-from-cache and new-build paths, so a later header filter can't drop them without failing a test. - **getbb.app** (`apps/web/src/server-entry.ts`, new `server/document-response.ts`): the render handler applies the same two headers to every document response. Server routes (`/api/*`, etc.) don't go through this path. The `/oauth/authorize` route's own frame headers are removed because the shared path now covers them; its `cache-control`/`x-robots-tag` stay. The existing marketplace status/cache-control rewrite moved into the same function. **Nothing legitimate frames the app.** Checked before denying all framers: - Desktop loads the server URL top-level in a `BrowserWindow`. - The embedded browser is a native `WebContentsView`, not an iframe. - Mobile loads it as the top-level document of a `react-native-webview`. - The only iframes in `apps/app` and the plugins are content previews. They frame file/preview URLs, never the shell: `FilePreview`, `docs`, `pdf-preview` (blob URL) and `inline-vis` (`srcDoc`). - Ladle, the Plugin Guide and `apps/web` contain no iframes. `frame-ancestors` is ignored for top-level documents, so the Electron and WebView loads are unaffected. **Not covered:** - Servers from before this change stay frameable through Connect until they update. Connect can't stamp the header itself without telling the shell apart from same-origin HTML file previews, which the app frames on purpose. - `apps/demo-server` (credential-less reviewer fixture on workers.dev) and the Vite dev server are not changed. **CSRF follow-up: yes, needs a separate audit (not fixed here).** Because of `Domain=.getbb.app; SameSite=Lax`, every share link is same-site with every bb and with getbb.app, so SameSite gives no protection between them. The bb server's public API already rejects foreign `Origin`s (`browser-request-guard.ts`, applied in `server.ts` `publicApi`) and requires JSON for mutations. Still worth auditing: - the `PLUGIN_WIRE_HTTP_PATH` bypass of that guard - the WebSocket upgrade's origin handling - Connect's own cookie-authenticated endpoints - getbb.app's account/link mutation endpoints (better-auth's trusted-origin checks) The cleaner long-term fix is probably a host-only cookie or a separate registrable domain for share links. ## How you verified - **Repro before (origin/main, `pnpm start:worktree`):** a page on `http://localhost:47123` with `<iframe src="http://127.0.0.1:20249/">` rendered the full bb app (sidebar, composer, "Approve for me") inside the frame. `curl -D -` showed no CSP/XFO. - **After, same setup:** Chrome blocks the frame with `Framing 'http://127.0.0.1:20249/' violates the following Content Security Policy directive: "frame-ancestors 'none'"`. The app still loads normally top-level. - **getbb.app (`vite dev` of `apps/web`):** - `/`, `/link`, `/dashboard`, `/oauth/authorize` and `/marketplace` all return `frame-ancestors 'none'` + `DENY`. `/oauth/authorize` has a single CSP header and keeps `no-store`. - The marketplace 503/`no-store` override still applies. - `/api/account/me` is unchanged. - **Tests:** - `apps/server/src/static-shell.test.ts` covers the shell on 200, the SPA fallback and the 304. It fails on origin/main (`expected null to be 'frame-ancestors \'none\''`) and passes with the fix. - `apps/web/src/server/document-response.test.ts` checks that the headers are applied, that a route's own CSP is kept, and that the status/cache overrides still work. - The Connect and Connect-next shell-cache tests assert the headers on miss, revalidated and new-build responses. - **Commands:** - `pnpm exec turbo run typecheck test --filter=@bb/server --filter=@bb/web --filter=@bb/connect --filter=@bb/connect-next`: all green except one unrelated `@bb/server` timeout under host load (`timeline-guard-coverage.test.ts`, 15 s). It passes when rerun alone. - `oxfmt --check` is clean. ๐ค Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The web app served by an environment sent no anti-framing headers. Only the OAuth error pages set them. A page that shares the session cookie's site could frame the signed-in app and steer a click onto a one-click action, such as Approve on
/connect-agentor a/new?prompt=link. The hosted/approve-agentpage already refuses to render inside a frame. The local/connect-agentpage only has an arm delay.Fix: HTML responses from the static SPA handler now send
Content-Security-Policy: frame-ancestors 'none'andX-Frame-Options: DENY, on both the streamed and fallback paths. Nothing frames the SPA itself: in-app iframes load attachments and assets from other routes, desktop loads the renderer over its own protocol, and the desktop browser panel is a native view. Vite dev serves its ownindex.html, so dev is unchanged.The existing static HTML test now asserts both headers. It fails without the change.
๐ค Generated with Claude Code (Claude Opus 5.5)