Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content Security Policy as a blacklist

Can I use the Content Security Policy Header to blacklist the loading of scripts from certain domains?

like image 959
genna Avatar asked Oct 19 '17 13:10

genna


People also ask

Is Content-Security-Policy deprecated?

CSP provides mechanisms to websites to restrict content that browsers will be allowed to load. X-Content-Security-Policy and X-Webkit-CSP HTTP headers are deprecated to implement CSP.

What does blocked by CSP mean?

What does blocked:csp mean? You may be seeing blocked:csp in Chrome developer tools when the browser is trying to load a resource. It might show up in the status column as (blocked:csp) CSP stands for Content Security Policy, and it is a browser security mechanism.

What does Content-Security-Policy protect against?

Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft, to site defacement, to malware distribution.

What is Content-Security-Policy vulnerability?

Identify Security Vulnerabilities in Your Web Apps and APIs The Content Security Policy (CSP) is a protection standard that helps secure websites and applications against various attacks, including data injection, clickjacking, and cross-site scripting attacks.


1 Answers

No you can’t. When you create a CSP policy, it’s basically a “deny all” policy. You then add back “allow from” exceptions to that. But you can’t do it the other way around; this is, you can’t, in a CSP policy, express “allow all” as a default and then add back specific “deny from” exceptions.

like image 133
sideshowbarker Avatar answered Oct 16 '22 13:10

sideshowbarker