From 19002f4c21d12e55df7e16d8bbc18616dd4c0a45 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 13 May 2026 13:04:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(audit-wave-11):=20CSP=20nonce=20middleware?= =?UTF-8?q?=20=E2=80=94=20drops=20'unsafe-inline'=20in=20prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build-auditor H1: prod `script-src` previously kept `'unsafe-inline'` because dropping it requires a per-request nonce that Next's RSC bootstrap + Server Actions can thread into their inline scripts. Implement the nonce mechanism in `src/proxy.ts`: 1. Mint a base64-encoded UUID per request as the CSP nonce. 2. Set the nonce on the REQUEST headers via `content-security-policy` + `x-nonce` so Next.js's RSC layer reads the active CSP and stamps `nonce=` onto every inline `