Repository navigation
fix(hosting,inertia): nonce-based production CSP; sandbox CSPs intersect; RedactionFilter redacts tracebacks - #804
Merged
Conversation
…ect; RedactionFilter redacts tracebacks - production script-src/script-src-elem: 'self' 'nonce-<per-request>' 'strict-dynamic', no 'unsafe-inline'/'unsafe-eval'; the host and scaffold templates and the Inertia adapter's module tags carry the nonce (request.state.csp_nonce); development keeps the Vite/HMR policy (#785) - a response CSP with `sandbox` is sent beside the app policy so browsers enforce the intersection (#785) - SPA mounts stamp the nonce onto their index.html scripts and drop its validators - RedactionFilter formats and redacts exc_info and stack_info on plain handlers (#789) Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
…en a CSP is set; comment placement Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- 'wasm-unsafe-eval' keeps WebAssembly compiling under the nonce policy - 304 responses carry no CSP, so a cached document keeps its matching nonce - SPA shell read off the event loop; conditional requests get a fresh shell; nonce detection needs a real attribute - CHANGELOG: CSP change under Changed with upgrade notes; sandbox framing impact Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- SPA shells: nonce on modulepreload / as=script preloads; drop accept-ranges - docs: wasm-unsafe-eval, 304 rule, no shared caching of nonce documents, shells never answer 304; CHANGELOG notes that script-src origins are ignored under 'strict-dynamic' Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
Deploying simple-module-python with
|
| Latest commit: |
ae1c8df
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7ccebb5c.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-hosting-review-csp-loggi.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
script-src/script-src-elemchange from'unsafe-inline' 'unsafe-eval'to'self' 'nonce-<per-request>' 'strict-dynamic'(plus'wasm-unsafe-eval'so WebAssembly still compiles).SecurityHeadersMiddlewaremints a nonce per HTTP request (request.state.csp_nonce).<script>plus script preloads) carry it.nonce=; inline handlers andevalno longer run;script-srcorigins are ignored under'strict-dynamic'.sandbox(file_storage downloads) is sent beside the app policy, so browsers enforce both; such responses now also getframe-ancestors 'self'.RedactionFilteron plain handlers formats and redactsexc_infoandstack_info, so secrets in exception messages no longer reach the output.Closes #785
Closes #789
Verification
SM_ENVIRONMENT=staging, built assets) on port8233: 10 pages via client-side navigation, dialogs, settings save, 404, file downloadmake lint,make test-py(7528 passed),make test-js(886),make doctorall green; e2e suite 53 passedQA Report
Test plan
https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq