Changeset fe9164f in Klonkt


Ignore:
Timestamp:
06/28/2026 02:15:48 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
f1627b6
Parents:
a8b4f10
Message:

chore(csp): default-src 'none' (deny by default) + explicit manifest-src/worker-src

Tightens CSP to deny-by-default; the PWA manifest + service worker (previously covered by the
implicit default-src 'self') are listed explicitly so they keep working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    ra8b4f10 rfe9164f  
    9999  contentSecurityPolicy: {
    100100    directives: {
    101       defaultSrc: ["'self'"],
     101      defaultSrc: ["'none'"],
    102102      // Strict CSP: a per-request nonce + 'strict-dynamic' (no 'unsafe-inline', no broad host
    103103      // sources — securityheaders/Observatory flag those). Trusted (nonce'd) scripts may load
     
    132132      // renderPage — it shows untrusted remote content next to the interact buttons.
    133133      frameSrc: ["'self'", "https:"],
     134      // default-src is 'none' (deny by default), so resource types that were implicitly covered
     135      // by the old default-src 'self' must be listed explicitly: the PWA manifest and the
     136      // service worker. (base-uri/form-action/frame-ancestors/object-src 'none' come from
     137      // Helmet's defaults; img/style/connect/media/font/frame are set above.)
     138      manifestSrc: ["'self'"],
     139      workerSrc: ["'self'", "blob:"],
    134140    },
    135141  },
Note: See TracChangeset for help on using the changeset viewer.