Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox#252
Draft
Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox#252
Conversation
Member
|
Context: I'm at a talk about strix, and was wondering how copilot compares |
…unny Fonts, iframe sandbox Co-authored-by: benfoxall <51385+benfoxall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Run security audit on remotehack.space and apply fixes
Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox
Feb 25, 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.
Security audit of remotehack.space — several attack vectors identified and mitigated.
Attack vectors & fixes
Content Security Policy (high)
No CSP existed, leaving the site open to XSS and resource injection. Added a strict CSP
<meta>tag:Inline scripts blocked a strict CSP (medium)
Two inline
<script>blocks (nav active-link highlight, local-time formatting) would have requiredunsafe-inline, defeating script-src protection.assets/nav-current.jsassets/local-time.js<script>blocks inhack.htmlandindex.htmlreplaced with<span class="local-time">driven by the new external scriptGoogle Fonts → Bunny Fonts (medium / GDPR)
Every page load was sending user IPs to Google. Swapped
fonts.googleapis.com/fonts.gstatic.comfor Bunny Fonts — drop-in compatible, GDPR-compliant, no IP logging.Referrer Policy (low-medium)
Full page URLs were leaking to external sites via
Refererheader on every outbound click.Spotify iframe sandbox (low)
Embedded iframe had unrestricted browser API access. Added:
Player functionality is preserved; top-navigation and popup access are removed.
External link
rel(low)Added
rel="noopener noreferrer"to external footer links.Note:
X-Frame-Options,X-Content-Type-Options, andframe-ancestorsCSP require HTTP response headers and cannot be set via<meta>on GitHub Pages — clickjacking protection at that level would need a proxy (e.g. Cloudflare) in front.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/usr/bin/curl curl -s REDACTED;600&family=Space+Mono:wght@400&display=swap(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.