Open
Conversation
- Uncomment and configure CSP initializer - Allow Google Fonts for font sources - Use nonces for script sources (Turbo/Stimulus compatible) - Allow unsafe-inline for styles (needed for accent colors) - Allow common image sources including https, data, and blob - Allow tally.so for embedded forms - Set strict defaults: object-src none, base-uri self, form-action self Security: Closes #18
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
Enable Content Security Policy (CSP) to protect against XSS and other injection attacks.
Changes
self- restrict resources to same origin by defaultfonts.gstatic.com) and data URIshttps,data:, andblob:for images (supports external images and file uploads)selfwithstrict-dynamicand nonces for Turbo/Stimulus compatibilityunsafe-inline(needed for accent color inline styles)selfandhttpsfor API callstally.sofor embedded formsnone(security best practice)self(prevent base tag hijacking)self(restrict form submissions)Security
This addresses a HIGH severity issue. A disabled CSP leaves the application vulnerable to:
Testing
After deployment, verify:
If issues arise, consider enabling
report_onlymode first to identify violations before enforcing.Closes #18