568 views
2 2 votes

Content Security Policy (CSP) is promoted as a way to mitigate content injection vulnerabilities including cross-site scripting. When making a website when should a CSP header be included and when is it of no use?

I read https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

which explained what CSP is, but I am still confused as to when to use it.

 

0% Accept Rate Accepted 0 answers out of 1 questions

1 Answer

3 3 votes

Content Security Policy (CSP) is designed to mitigate when attackers find a website vulnerable to XSS attacks, they have two options of injecting malicious scripts into it:

  • Inline script: when attackers put their code directly into your website’s HTML.
  • Load script from an external domain: when attackers load a script from multiple infected sites and modify the script when they need to. All the changes will be reflected on those sites.

However it could happen to any website, but it is most useful to be implemented when your web pages contain HTML forms for users to submit data but also can be exploited to run the malicious commands on the server.

Related questions

1 1 vote
1 1 answer
509
509 views
machinelearning asked Sep 29, 2018
509 views
I am looking for a one-page free template that is bootstrap compatible and could be used for designing my resume?
1 1 vote
1 1 answer
565
565 views
1 1 vote
1 1 answer
799
799 views
Shahram asked Dec 6, 2018
799 views
I've created a server on Digital Ocean, and employed uWSGI + NGINX to run a Flask application on the Ubuntu server. I need to copy some files from my computer to the serv...
0 0 votes
0 0 answers
1.3k
1.3k views
NewDS64 asked Feb 22, 2023
1,311 views
When pre processing data for machine learning. Is there any difference in using one hot encoding to turn categoric variables into numeric variables or to segment the data...
1 1 vote
1 1 answer
652
652 views
Math asked Oct 12, 2018
652 views
I need to submit an assignment in Word Document format, and the size of file is so big after attaching the photos taken by my cell-phone, what should I do?