Skip to content

Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox#252

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/run-security-audit-remotehack
Draft

Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox#252
Copilot wants to merge 2 commits intomainfrom
copilot/run-security-audit-remotehack

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

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:

default-src 'self';
script-src 'self';
style-src 'self' https://fonts.bunny.net;
font-src https://fonts.bunny.net;
img-src 'self' data:;
frame-src https://open.spotify.com;
connect-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self'

Inline scripts blocked a strict CSP (medium)

Two inline <script> blocks (nav active-link highlight, local-time formatting) would have required unsafe-inline, defeating script-src protection.

  • Nav script → assets/nav-current.js
  • Local-time script → assets/local-time.js
  • Template <script> blocks in hack.html and index.html replaced with <span class="local-time"> driven by the new external script

Google Fonts → Bunny Fonts (medium / GDPR)

Every page load was sending user IPs to Google. Swapped fonts.googleapis.com / fonts.gstatic.com for Bunny Fonts — drop-in compatible, GDPR-compliant, no IP logging.

Referrer Policy (low-medium)

Full page URLs were leaking to external sites via Referer header on every outbound click.

<meta name="referrer" content="strict-origin-when-cross-origin">

Spotify iframe sandbox (low)

Embedded iframe had unrestricted browser API access. Added:

sandbox="allow-scripts allow-same-origin allow-presentation"

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, and frame-ancestors CSP 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
    • Triggering command: /usr/bin/curl curl -s REDACTED;600&amp;family=Space&#43;Mono:wght@400&amp;display=swap (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

would you be able to run a security audit on remotehack.space?

try and compile any attack vectors that we have open.

and then apply fixes for any that you find!


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

@benfoxall
Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants