Repository navigation
fix(page-frames): treat the Pages alias as same-origin - #352
Conversation
Prevent frames using the redirecting GitHub Pages host from escaping the same-origin sandbox restriction. Hive-Run: hivecommons#349 Hive-Plan: page-frames-origin-alias Hive-Spec: issue-349#same-origin-alias Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Evidence bundle `#35289ddf5a` sha256:01c45a1f763cf0c91c6ea5a1922920feff98798e08092ae47c82e809a73d1f11 — download from the dashboard or `hivectl review evidence #352`. |
There was a problem hiding this comment.
Style review at 89ddf5a (read scripts/page-frames.test.mjs in full, ran node --test scripts/page-frames.test.mjs: 12/12 pass). No blocker; one fixture-accuracy note.
Protocol-relative fixture is attributed to the alias set, but that is not what makes it pass — scripts/page-frames.test.mjs:93. //hivecommons.github.io/project/ never reaches KNOWN_FRAME_ORIGINS (line 33 only matches ^https?://); it returns true from the scheme-less fallthrough on line 34, exactly as //evil.example.org/ would. Listing it under "GitHub Pages aliases count as same-origin" (line 89) and the PR body's "protocol-relative forms" makes a future reader think the alias allowlist governs // URLs. Suggest moving it next to the conservative rule it actually exercises, with a non-alias host to make the point:
"HTTPS://HIVECOMMONS.GITHUB.IO/project/",
]) {
and in the first fixture block (after line 86):
// scheme-less src (including protocol-relative) is conservatively same-origin regardless of host
assert.equal(isSameOriginFrame('<iframe src="//hivecommons.github.io/project/" title="x">'), true);
assert.equal(isSameOriginFrame('<iframe src="//example.org/project/" title="x">'), true);Nit (non-blocking): header comment line 6 is now 93 cols; the rest of the block wraps at ~80.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Ready for a human merge: verdict approved @89ddf5a, 4/4 checks green, DCO yes, soak 10m0s elapsed. Blocked only by The hive never approves on your behalf: |
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
There was a problem hiding this comment.
Approved by @clubanderson for Hive auto-merge on green CI.
Approved from the Hive dashboard by @clubanderson as the owner decision on a Ready-for-human-merge pull request; the hive's merge sweep merges it on green CI.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hive queued this PR but could not set the |
|
Merged by hive contributor-lane auto-merge: CI green for ≥10m, reviewer verdict approve, @clubanderson approved this head as the owner decision ( |
Summary
GitHub Pages redirects the organization's fallback host to the custom domain, so an iframe using that host can load a same-origin document. The frame gate must reject
allow-scripts allow-same-originfor that alias as well, or the embedded document can remove its sandbox.Closes #349
Regression fixtures cover the alias, uppercase and protocol-relative forms, unsafe token pairing, scripts-only sandboxing, and unrelated or lookalike hosts. The README describes the extended gate. Existing frame URLs and public helper names are preserved.
Validation
Tests, builds, and linters were not run locally, as required by the task. The existing CI test job runs
node --test scripts/*.test.mjs, including these regression fixtures.hive/awaiting-ci: CI pending — sweep will merge when green.
Checklist
AI assistance: implemented with Codex under the contributor's GitHub identity.
— hive: agent=scanner backend=codex model=gpt-6.1-sol effort=high