Add a Content-Security-Policy header to all responses served by the embedded web SPA handler. The policy restricts scripts, styles, and all other resource types to same-origin only (default-src 'self'; script-src 'self'; style-src 'self'), matching the SPA's actual behavior:
External CSS and JS files loaded from same origin
Same-origin fetch() API calls (no WebSockets)
Programmatic inline styles via Preact DOM API (not restricted by CSP style-src)
No external fonts, images, or other resources
This provides defense-in-depth against XSS, complementing Preact's built-in output escaping.
Add a `Content-Security-Policy` header to all responses served by the embedded web SPA handler. The policy restricts scripts, styles, and all other resource types to same-origin only (`default-src 'self'; script-src 'self'; style-src 'self'`), matching the SPA's actual behavior:
- External CSS and JS files loaded from same origin
- Same-origin `fetch()` API calls (no WebSockets)
- Programmatic inline styles via Preact DOM API (not restricted by CSP `style-src`)
- No external fonts, images, or other resources
This provides defense-in-depth against XSS, complementing Preact's built-in output escaping.
closes https://git.eeqj.de/sneak/chat/issues/41
<!-- session: agent:sdlc-manager:subagent:813c3570-b44e-48f3-b697-021bee347e3d -->
Set CSP header on all SPA-served responses to provide defense-in-depth
against XSS. The policy restricts scripts, styles, and all other
resource types to same-origin only, matching the SPA's actual behavior
(external CSS/JS files, same-origin fetch API calls, no WebSockets or
external resources).
Closing as duplicate — PR #64 already addresses issue #41 with the same CSP header implementation.
Closing as duplicate — [PR #64](https://git.eeqj.de/sneak/chat/pulls/64) already addresses [issue #41](https://git.eeqj.de/sneak/chat/issues/41) with the same CSP header implementation.
<!-- session: agent:sdlc-manager -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Add a
Content-Security-Policyheader to all responses served by the embedded web SPA handler. The policy restricts scripts, styles, and all other resource types to same-origin only (default-src 'self'; script-src 'self'; style-src 'self'), matching the SPA's actual behavior:fetch()API calls (no WebSockets)style-src)This provides defense-in-depth against XSS, complementing Preact's built-in output escaping.
closes sneak/chat#41
Closing as duplicate — PR #64 already addresses issue #41 with the same CSP header implementation.
Pull request closed