Problem
The Next.js config is minimal — no CSP, HSTS, X-Frame-Options, X-Content-Type-Options, or Referrer-Policy. Any user-uploaded content (snippets in /playground, badge URLs in workspace files) currently runs without a CSP backstop.
Acceptance Criteria
Pointers
Difficulty
Medium. Tuning the CSP without breaking Next dev is the real work.
Problem
The Next.js config is minimal — no CSP, HSTS, X-Frame-Options, X-Content-Type-Options, or Referrer-Policy. Any user-uploaded content (snippets in
/playground, badge URLs in workspace files) currently runs without a CSP backstop.Acceptance Criteria
headers()block tofrontend/next.config.tscovering:Content-Security-Policy(default-src 'self', allow inline styles for Tailwind v4 dev only, no eval)Strict-Transport-Security: max-age=31536000; includeSubDomainsX-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originPermissions-Policy: camera=(), microphone=(), geolocation=()CSP_REPORT_ONLY=1env, then promoted to enforced/,/scan, and/api/analyze, assert each is presentPointers
Difficulty
Medium. Tuning the CSP without breaking Next dev is the real work.