CSP nonce
Per-request random string som tillåter specifika inline-scripts under CSP utan att behöva 'unsafe-inline'. Sätt nonce i CSP-headern + samma nonce-attribut på <script>-taggen.
Flöde: server genererar fresh nonce per request → embedded i header (Content-Security-Policy: script-src 'nonce-xyz123' 'self') + i HTML (<script nonce="xyz123">...</script>). Bara scripts med matchande nonce kör. Inline-script utan nonce = blockerat = XSS-skydd. Komplement: 'strict-dynamic' tillåter nonce'd script att lasta andra scripts. Trade-off: kräver request-templating av nonce (kan inte cachas statiskt). Sha-hash-alternative: hasha specifik inline-script-content. Standard modern web app utan unsafe-inline.