Security hardening: CSP, Referrer Policy, Bunny Fonts, iframe sandbox#252
Conversation
|
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 please confirm whether merging this would break the current site or disrupt any current functionality. Please base this analysis on the current HEAD ref of the |
Analysis based on the current Core functionality is preserved — navigation, layout, fonts, the local-time display, and the previous-hacks summariser all continue to work. Here are the three areas where the strict CSP introduces visible side-effects: 1. Twitter embed on
|
|
Superseded by #270 |
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.