Skip to content

fix(page-frames): treat the Pages alias as same-origin - #352

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
thatguywob:scanner/fix-349
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
thatguywob:scanner/fix-349

Conversation

@thatguywob

@thatguywob thatguywob commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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-origin for 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

  • Commits carry a matching DCO sign-off.
  • No rendered page, redirect, inline script, or asset changed.

AI assistance: implemented with Codex under the contributor's GitHub identity.

— hive: agent=scanner backend=codex model=gpt-6.1-sol effort=high

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>
@hivecommons-hive

hivecommons-hive Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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`.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @89ddf5a, 4/4 checks green, DCO yes, soak 10m0s elapsed. Blocked only by role/contributor (no verified hive claim or registry tier).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow

Copy link
Copy Markdown

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

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.

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.

@hivecommons-hive hivecommons-hive Bot added the lgtm label Nov 5, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive queued this PR but could not set the prow/lgtm commit status, so Prow may strip the lgtm label and the auto-merge queue may not hold.

@hivecommons-hive
hivecommons-hive Bot merged commit aac6099 into hivecommons:main Nov 5, 2026
6 of 7 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Merged by hive contributor-lane auto-merge: CI green for ≥10m, reviewer verdict approve, @clubanderson approved this head as the owner decision (admitted_by: operator-approval:clubanderson) — merged as-is on that approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[reviewer] Review backlog (correctness): page-frames gate treats hivecommons.github.io as cross-origin

1 participant