Skip to content

fix(hosting,inertia): nonce-based production CSP; sandbox CSPs intersect; RedactionFilter redacts tracebacks - #804

Merged
antosubash merged 5 commits into
mainfrom
fix/hosting-review-csp-logging
Nov 3, 2026
Merged

antosubash merged 5 commits into
mainfrom
fix/hosting-review-csp-logging

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Closes #785
Closes #789

Verification

  • Browser-verified in production mode (SM_ENVIRONMENT=staging, built assets) on port 8233: 10 pages via client-side navigation, dialogs, settings save, 404, file download
  • Console: zero CSP / "Refused to …" messages; a fresh nonce on every response
  • Local CI: make lint, make test-py (7528 passed), make test-js (886), make doctor all green; e2e suite 53 passed
  • Verification report: https://claude.ai/artifact/UBuEnuZQtBvmffggQgRb3A

QA Report

  • QA cycle completed (1 iteration, production mode), 0 bugs found
  • Categories tested: Happy Path, Error States

Report links are Claude Artifacts and start private — the author can share them
from claude.ai/code/artifacts if reviewers need access.

Test plan

  • Production build: pages render with no CSP console errors
  • CI is green

https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq

…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
- '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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

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

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-03T20:42:10.450450Z ae1c8df PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 84cf3df into main Nov 3, 2026
17 checks passed
@antosubash
antosubash deleted the fix/hosting-review-csp-logging branch November 3, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant