Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CSP
Cross Site Scripting (XSS) attacks are easier and easier to perform as new features are introduced to the web stack. As a result they are becoming harder and harder to detect and filter out on the server-side. One thing all XSS has in common is that information needs to be exfiltrated in order for the attack to be successful. One way to fight XSS is therefore to only send data to trusted sources.
Browsers now allow us to give them a whitelist of trusted domains, and they simply do not load any data from any other source: This is implemented under a standard called Content Security Policy (CSP). The simplicity of this system makes it very strong. It cuts off a single feature which XSS relies upon. It does however have some cons and is therefore up for discussion.
Pros
Cons