Repository navigation
fix(security): drop Replit and Google Fonts hosts from the CSP - #245
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
script-srchttps://replit.comstyle-srchttps://fonts.googleapis.comconnect-srchttps://fonts.googleapis.com,https://fonts.gstatic.comfont-srchttps://fonts.gstatic.comws:/wss:,blob:,data:and the configuredframe-ancestorsare unchanged.Test change (approved by the owner)
tests/server/dev-entrypoint.test.tsnow expectsconnect-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 withe2e/self-contained-page-load.spec.tsfrom #244, both the page and the policy are guarded.Test plan
./run-tests.sh– all 11 stages green (E2E 28/28)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