Repository navigation
π fix: sandbox the GitHub Universe talk player and gate its allowlist - #309
Conversation
The youtube-nocookie iframe is the only third-party frame on the site. Restrict it to the sandbox tokens the embed needs (scripts, same-origin, popups for 'Watch on YouTube', presentation for casting) so the frame can no longer navigate the page, submit forms, open modals or start downloads. featured-video.test.mjs now asserts the exact token set. Closes #308 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
Read index.html:405-410 and scripts/featured-video.test.mjs at 5d90d1d. Looks correct to me.
- The
sandboxtoken set (allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation) is what the youtube-nocookie embed needs: scripts + same-origin for the player itself (cross-origin to this page, so same-origin here is youtube's origin, not ours), popups to open "Watch on YouTube" in a new tab, presentation for cast. Noallow-top-navigation*, so a creative cannot navigate the top-level page; fullscreen stays governed byallow="fullscreen"/allowfullscreen, which the existing test atfeatured-video.test.mjs:41-42already pins. - The new test uses the existing
attribute()helper (featured-video.test.mjs:11-15), which asserts the attribute is present, so it fails onmainas the body says. The exact-setdeepEqualplus the negative-prefix loop means any later addition of navigation/forms/modals/downloads tokens trips the gate. - CSP (
index.html:5,frame-src https://www.youtube-nocookie.com) is unchanged; no inline script touched, so no hash update needed.
One thing I could not verify statically: actual playback under the sandbox in the Pages preview, as the body itself asks. That is a two-click check for whoever merges.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Read The one thing I cannot verify statically is the body's own caveat: that the player still plays and casts under this token set in the Pages preview. That check belongs to whoever merges. Evidence bundle `#3095d90d1d` sha256:48a28a765886ad8e037db1b74339257e2451b4c968f6f3826bc88102b3bb285d β download from the dashboard or `hivectl review evidence #309`. |
Summary
Adds a
sandboxallowlist to the GitHub Universe talk player onindex.html(added in #307) and makesscripts/featured-video.test.mjsassert the exact token set, so navigation/forms/modals/downloads tokens cannot be added later without failing the gate. README's description of the gate is updated to match.Why: the youtube-nocookie frame is the only third-party-controlled frame on a site whose CSP is otherwise
default-src 'none'; the player serves third-party creatives, and an unsandboxed frame can navigate the top-level page on user activation. The allowlist (allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation) is what the embed needs to play, open "Watch on YouTube" in a new tab, and cast. Fullscreen is governed byallow/allowfullscreen, not sandbox, and is unchanged.Please confirm playback in the Pages preview before merging β this is behavioural for the player, not just markup.
Closes #308
Screenshots
No visible change at rest; player chrome is identical.
Checks run locally
node --test scripts/*.test.mjs(809 pass; the new assertion fails onmainwith "missing sandbox attribute")scripts/check-links.sh --external-warn(no link changes)scripts/check-links.test.shscripts/check-redirects.test.shscripts/check-redirects.shChecklist
<script>edited (no CSP hash update needed)git commit -s)Filed by sec-check agent (ACMM L6 β full mode)
β hive: agent=sec-check backend=copilot model=claude-fable-5.1 copilot=1.0.88