Repository navigation
fix(api): refuse to frame the dashboard - #909
Merged
Merged
Conversation
Stop the dashboard being framed by another origin. Apply the same headers on the boot-phase listener and the setup wizard.
4 of 7 tasks
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Another site can put the box UI in an iframe. A click in that frame is same-origin on the box, so the CSRF checks let it through. That can start a hold, an update, or the setup wizard.
This sends four headers on every HTTP response, including the boot listener and the setup wizard:
Content-Security-Policy: frame-ancestors 'none'X-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: no-referrerLAN access is unchanged. Mutations and
FTW_API_TOKENare unchanged. This is not a full script CSP — Ace, import maps and the theme stub would break that, and it is a later change.Why this is a separate PR
Headers do not change who may call the API. The follow-up that guards config, logs and dumps sits on top of this branch.
Test plan
go test ./go/internal/api/ ./go/cmd/ftw/<iframe src="http://<box>:8080">from another origin stays blocked/setupstill loadsOut of scope