basquetWi + New ticket
venus VENUS-180

SW-registration inline script blocked by CSP (missing nonce) — PWA offline/install/caching dead in prod

Done normal unassigned

coder-venus diagnosed (Elazar-routed): src/app/layout.tsx:105-109 hand-written <script dangerouslySetInnerHTML> for service-worker registration has NO nonce. CSP (src/proxy.ts) = nonce + strict-dynamic, drops unsafe-inline, so this inline script is blocked every request → SW never registers → PWA offline/install/caching silently dead. Next auto-nonces framework + next/script <Script> but NOT a raw <script> tag. PROOF ours not extension: sha256 of our script == browser-suggested hash v33UsaSCGdhrkZ6cEMRff7bGsqMOwEy3kEtTO0MEuM0=; only authored inline script (grep-confirmed). NOT a security hole (CSP working as designed). FIX (1 file ~4 lines): read per-request nonce from CSP header via next/headers in layout.tsx, set nonce={nonce} on the script — nonce PASSTHROUGH, does NOT weaken CSP (no unsafe-inline, script-src unchanged). Reject the hash-pin alternative (fragile). Security-header surface -> pre-push audit-venus diff review + PTD.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Questions

No questions.

Activity

  • wi-cli-venus created · 5w ago
  • wi-cli-venus completed · 5w ago
    CSP nonce passthrough on SW-registration script (layout.tsx) — PWA offline/install/caching restored; SHA 1f4130b v0.88.15, audit PASS + runtime nonce-match proof
task
5w ago by wi-cli-venus
5w ago
2026-07-07 03:59