Inbox: allow an exact https origin to frame the Inbox (config-only, opt-in), for a self-hosted proxy host

未关闭
#3,597 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
security

调研方向

Read packages/server/inbox-framing.ts and the existing inboxFrameAncestors handling in packages/server/inbox.ts; then inspect the config type in packages/shared/config.ts. The issue names inbox-framing.test.ts and inbox-frame-ancestors.test.ts as tests to run. Done means the opt-in exact HTTPS DNS origins are validated, merged only for local Inbox requests, documented, and unset or empty config preserves current responses byte for byte.

由索引模型根据 Issue 内容生成。

描述

Problem

inboxFrameAncestors (#3299, #3376, since 0.28.66) lets a trusted app on this computer frame the Inbox. It keeps only localhost, *.localhost, 127.0.0.0/8 and app-scheme origins (packages/server/inbox-framing.ts, inboxFrameAncestor).

A self-hosted agent workspace can run on the same machine as Plannotator but be opened from other devices over a private network, at an https origin such as https://workspace.example.internal. It serves Plannotator's windows through an authenticated reverse proxy, each window on an origin of its own, so the window's requests reach Plannotator as local (Host: localhost:<port>). The plan, code-review and annotate servers can be framed there already, because they send no framing headers. The Inbox cannot: its frame-ancestors 'none' stays, and the only way around it is for the proxy to rewrite Plannotator's security headers, which is the brittle approach #3299 wanted to avoid.

Proposal

A second, config-only key, so the existing key keeps its "an app on this computer" meaning:

{ "inboxFrameAncestorsRemote": ["https://workspace.example.internal"] }
  • Accept only exact https:// origins with a DNS host name: no http:, no IP literal (v4 or v6), no wildcard, no path, no credentials, no 'self'; the default port only when written without one, as the existing validator does.
  • Same scope as inboxFrameAncestors: applied only to requests the Inbox treats as local (via === "local"), never on the tailnet listener or a device-door request; merged into the same frame-ancestors list and into the 'self' <list> of the documents the Inbox frames. X-Frame-Options is dropped only when the merged list is not empty.
  • Unset or empty: every answer byte-for-byte as today. Dropped entries: one stderr line each, as today.
  • No environment variable, matching the existing key's config-only choice.

Likely files: packages/server/inbox-framing.ts (a remote validator beside inboxFrameAncestor, merged in resolveInboxFrameAncestors), packages/server/inbox.ts (read the key where inboxFrameAncestors is read), packages/shared/config.ts (type), docs (environment.md, inbox-phones-and-security.md) and tests (inbox-framing.test.ts, inbox-frame-ancestors.test.ts).

Related observation

The plan, code-review and annotate servers send no X-Frame-Options or frame-ancestors, so any page that learns their loopback URL can frame them while they wait for a decision (clickjacking of Approve/Deny). Writes are already guarded by Sec-Fetch-Site, which limits but does not remove the risk of a framed click. A default of frame-ancestors 'self', with the same opt-in lists, would close that without breaking hosts that embed them on purpose. Happy to split this into its own issue.

Evidence

  • Checked at v0.28.67 and at main b5b307783 (2026-11-17): no change to the Inbox framing rules since the tag.
  • A working reverse-proxy integration framed plan reviews with no Plannotator change: approve, and deny with feedback, each reached the right agent session. Only the Inbox needed a header replacement on the proxy.
主要语言
TypeScript
星标
8.7k
派生
649
平均合并
16 小时 1 分钟
30 天内合并 PR
756

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

backnotprop/plannotator 的其他 Issue

查看 backnotprop/plannotator 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。