Add Content-Security-Policy and HSTS headers #96

Open
opened 2026-10-09 15:31:08 -04:00 by goddard · 0 comments
Collaborator

The controller sends no Content-Security-Policy and no Strict-Transport-Security header.

  • svelte.config.js has no kit.csp.
  • guard.ts:106-110 sets Cache-Control, Referrer-Policy, nosniff and X-Frame-Options, but not CSP or HSTS.

Player names, chat and GitHub release notes are attacker-controlled. They're escaped today (there's no {@html} in the UI), so this is a second layer if that ever slips.

Fix

  • Add kit.csp with mode: 'auto', including default-src 'self', object-src 'none', base-uri 'self', form-action 'self' and frame-ancestors 'none'
  • Send Strict-Transport-Security on HTTPS responses
The controller sends no Content-Security-Policy and no Strict-Transport-Security header. - `svelte.config.js` has no `kit.csp`. - `guard.ts:106-110` sets Cache-Control, Referrer-Policy, nosniff and X-Frame-Options, but not CSP or HSTS. Player names, chat and GitHub release notes are attacker-controlled. They're escaped today (there's no `{@html}` in the UI), so this is a second layer if that ever slips. **Fix** - [ ] Add `kit.csp` with `mode: 'auto'`, including `default-src 'self'`, `object-src 'none'`, `base-uri 'self'`, `form-action 'self'` and `frame-ancestors 'none'` - [ ] Send `Strict-Transport-Security` on HTTPS responses
goddard added the
priority
low
type/hardening
labels 2026-10-09 15:31:08 -04:00
josh was assigned by goddard 2026-10-09 15:31:08 -04:00
Sign in to join this conversation.