Skip to content

K13.9: Content-Security-Policy (enforced where safe, report-only for the rest) - #144

Merged
MFrancis-dev merged 1 commit into
mainfrom
fix/csp
Nov 8, 2026
Merged

MFrancis-dev merged 1 commit into
mainfrom
fix/csp

Conversation

@MFrancis-dev

Copy link
Copy Markdown
Owner

Fix 8 from the pre-launch review (hardening).

Problem: no Content-Security-Policy at all.

Why not fully enforced: the wallet connector runs wallets in srcdoc sandbox frames, which inherit the page's policy. A strict script-src could break wallet sign-in, and that can't be tested without a real wallet.

Fix:

  • Enforced: object-src 'none'; frame-ancestors 'none' (can't affect wallet code)
  • Report-only: default-src 'self', scripts/styles self + inline (Next.js bootstraps inline), images/fonts/media self, connect-src 'self' https: wss:, frame-src 'self', base-uri/form-action 'self'
  • New follow-up K13.10 (K13.10 Enforce the full Content-Security-Policy after a real-wallet sign-in #143): enforce the full policy after a real-wallet sign-in shows no violations

Checked: production build in a clean copy, both headers served; landing, demo, overview and Add funds: no CSP violations in the console. Header test added; 151 tests.

Docs: README status, ARCHITECTURE §7, ESSENTIALS, ROADMAP (K13.9 done, K13.10 added).

Closes #135

…eport-only

Wallets run in srcdoc sandbox frames that inherit the page's policy, and
sign-in can't be tested without a real wallet, so the full policy reports
violations instead of blocking until that test is done (K13.10).

Closes #135
@MFrancis-dev
MFrancis-dev merged commit 3dc2c2a into main Nov 8, 2026
4 checks passed
@MFrancis-dev
MFrancis-dev deleted the fix/csp branch November 8, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

K13.9 Add a Content-Security-Policy

2 participants