paragonie / csp-builder

Build Content-Security-Policy headers from a JSON file (or build them programmatically)
https://paragonie.com/projects
MIT License
544 stars 39 forks source link

un-deprecate `frame-src` #76

Closed fritzmg closed 8 months ago

fritzmg commented 9 months ago

Currently the CSPBuilder automatically adds both frame-src and child-src when using frame-src as frame-src was originally deprecated in CSP Level 2. However, in CSP Level 3 frame-src has been un-deprecated again and frame-src is now the preferred way of defining allowed iframe sources.

So I think the correct way to handle this within the CSPBuilder is to always add both child-src and frame-src for either one, if supportOldBrowsers is enabled.

The CSP Level 3 standard defines that you should use preferably either frame-src or worker-src (they did not however deprecate child-src technically, if I got that right).