Skip to content

fix(security): drop Replit and Google Fonts hosts from the CSP - #245

Merged
ttbombadil merged 1 commit into
mainfrom
fix/csp-drop-third-party-hosts
Oct 12, 2026
Merged

ttbombadil merged 1 commit into
mainfrom
fix/csp-drop-third-party-hosts

Conversation

@ttbombadil

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #244. The client no longer loads any third-party resource (fonts are self-hosted, the Replit banner script is gone), so the Content Security Policy no longer needs to allow those hosts:

Directive Removed
script-src https://replit.com
style-src https://fonts.googleapis.com
connect-src https://fonts.googleapis.com, https://fonts.gstatic.com
font-src https://fonts.gstatic.com

ws:/wss:, blob:, data: and the configured frame-ancestors are unchanged.

Test change (approved by the owner)

tests/server/dev-entrypoint.test.ts now expects connect-src 'self' ws: wss: and additionally asserts that the policy contains no third-party host except the configured frame-ancestor. RED with the old CSP, GREEN with the new one. Together with e2e/self-contained-page-load.spec.ts from #244, both the page and the policy are guarded.

Test plan

  • ./run-tests.sh – all 11 stages green (E2E 28/28)
  • Note: the first local run hit two unrelated unit tests that fail only under full-suite load (tutor.routes.test.ts "rejects a browser revision…" returned 401 instead of 400; examples.routes.test.ts "passes exact repository…" timed out). Both pass in isolation 3/3 and in the second full run; to be investigated separately.

🤖 Generated with Claude Code

Since #244 the client loads no third-party resources, so script-src,
style-src, connect-src and font-src only allow the UnoSim origin. The
entrypoint test now also rejects any third-party host in the policy
(test change approved by the owner).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ttbombadil
ttbombadil merged commit bbd4ac2 into main Oct 12, 2026
6 checks passed
@ttbombadil
ttbombadil deleted the fix/csp-drop-third-party-hosts branch October 12, 2026 09:02
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.

1 participant