Skip to content

Commit

Permalink
Update files/en-us/web/http/csp/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: Hamish Willee <[email protected]>
  • Loading branch information
wbamberg and hamishwillee authored Oct 18, 2024
1 parent c82a4b7 commit feba218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/http/csp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Unlike `unsafe-inline`, the `unsafe-eval` keyword does still work in a directive
To control script loading as a mitigation against XSS, recommended practice is to use nonce- or hash- based fetch directives. This is called a _strict CSP_. This type of CSP has two main advantages over a location-based CSP (usually called an _allowlist CSP_):

- Allowlist CSPs are hard to get right and often policies inadvertently whitelist unsafe domains, and hence don't provide effective protection against XSS (see [CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy](https://dl.acm.org/doi/pdf/10.1145/2976749.2978363)).
- Allowlist CSPs can be very large and hard to maintain. According to [How I learned to stop worrying and love the Content Security Policy](https://www.netlify.com/blog/general-availability-content-security-policy-csp-nonce-integration/), just to integrate Google Analytics, a developer is asked to add 187 Google domains to the allowlist.
- Allowlist CSPs can be very large and hard to maintain, in particular when using scripts that are outside of your control. According to [How I learned to stop worrying and love the Content Security Policy](https://www.netlify.com/blog/general-availability-content-security-policy-csp-nonce-integration/), just to integrate Google Analytics, a developer is asked to add 187 Google domains to the allowlist.

A nonce-based strict CSP looks like this:

Expand Down

0 comments on commit feba218

Please sign in to comment.