Document "strict CSP" and recommend it over allowlists #35812
Labels
Content:HTTP
HTTP docs
Content:Security
Security docs
effort: large
This task is large effort.
help wanted
If you know something about this topic, we would love your help!
The articles about CSP from both OWASP and web.dev recommend that developers use what they call a strict CSP, which uses nonces and/or hashes in
script-src
instead of an allowlist.According to these articles, strict CSP is likely to be more secure than an allowlist, and is also much easier to maintain than an allowlist, as this netlify article discusses.
There are 2 guides to CSP on MDN, that I could find:
(aside, I'm not sure of the value of having two guides here)
We should update these guides to talk about strict CSPs. There are really 2 options:
We talked about this in the SWAG CG meeting and it was felt that the second, more opinionated, approach was more useful.
This work should help contribute to w3c-cg/swag#3.
The text was updated successfully, but these errors were encountered: