content-security-policy

Content-Security-Policy object-src blob

早过忘川 提交于 2019-12-01 14:56:05
When using a content-security-policy and I try to follow a process in Chrome 41 (beta) using window.URL.createObjectURL I get an error like the following: Refused to load plugin data from 'blob:http%3A//localhost%3A7000/f59612b8-c760-43a4-98cd-fe2a44648393' because it violates the following Content Security Policy directive: "object-src blob://*" With a content security policy that restricts object-src or otherwise default-src one can reproduce the issue (with jQuery for convenience) like this: blob = new Blob( ["%PDF-1.\ntrailer<</Root<</Pages<</Kids[<</MediaBox[0 0 3 3]>>]>>>>>>"], { type:

content security policy error, but meta-tag includes URL

荒凉一梦 提交于 2019-12-01 14:21:26
Why am I receiving errors like this? Refused to load the script 'http://maps.googleapis.com/maps/api/js?v=3&sensor=false' because it violates the following Content Security Policy directive: "script-src 'self' *.googleapis.com 'unsafe-inline' 'unsafe-eval'". my meta-tag: <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' *.googleapis.com 'unsafe-inline'; script-src 'self' *.googleapis.com 'unsafe-inline' 'unsafe-eval'"> Seems like I needed explicit URI-scheme. This work: <meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self'

Content-Security-Policy object-src blob

若如初见. 提交于 2019-12-01 13:42:30
问题 When using a content-security-policy and I try to follow a process in Chrome 41 (beta) using window.URL.createObjectURL I get an error like the following: Refused to load plugin data from 'blob:http%3A//localhost%3A7000/f59612b8-c760-43a4-98cd-fe2a44648393' because it violates the following Content Security Policy directive: "object-src blob://*" With a content security policy that restricts object-src or otherwise default-src one can reproduce the issue (with jQuery for convenience) like

content security policy error, but meta-tag includes URL

天涯浪子 提交于 2019-12-01 12:17:47
问题 Why am I receiving errors like this? Refused to load the script 'http://maps.googleapis.com/maps/api/js?v=3&sensor=false' because it violates the following Content Security Policy directive: "script-src 'self' *.googleapis.com 'unsafe-inline' 'unsafe-eval'". my meta-tag: <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' *.googleapis.com 'unsafe-inline'; script-src 'self' *.googleapis.com 'unsafe-inline' 'unsafe-eval'"> 回答1: Seems like I needed explicit URI

CSP unsafe-eval using Google Maps API

吃可爱长大的小学妹 提交于 2019-12-01 10:33:48
问题 Getting script-src 'unsafe-eval' error when trying to use Google Maps' API. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> Here's the console error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' ' *.gstatic.com *.googleapis.com *.google-analytics.com *.google.com". You would think Google wouldn't have any unsafe

Java Server Faces and Content Security Policy?

不打扰是莪最后的温柔 提交于 2019-12-01 05:43:04
I would like to use Content Security Policy for my JSF 2.1 based Web projects as I think it could improve protection against XSS attacks significantly. Due to CSP's default behaviour to block all inline JavaScript it basically breaks JSF's <f:ajax execute="input" render="output" /> functionality. This is because JSF generates lots of inline JavaScript code when using the above stated construct. Does anybody know if there is a way to use CSP in JSF based projects which make use of f:ajax without the need to allow inline JS by using the following CSP directive: Content-Security-Policy: default

Content-Security-Policy (CSP) workaround for internet explorer

房东的猫 提交于 2019-12-01 05:10:28
We are building a ASP.NET website and want to allow only some domains who can iFrame our website. CSP is not supported in internet explorer. I am setting something like Response.AddHeader("Content-Security-Policy", "frame-ancestors mydomain1.com mydomain2.com") . How is everyone handling for internet explorer. I read IE supports X-Content-Security-Policy but it doesn't has frame-ancestors . Also I am removing the default X-Frame-Options header added by IIS by doing Response.Headers.Remove("X-Frame-Options") The solution recommended by Microsoft is the following: internally, whitelist domain1

Java Server Faces and Content Security Policy?

笑着哭i 提交于 2019-12-01 03:10:25
问题 I would like to use Content Security Policy for my JSF 2.1 based Web projects as I think it could improve protection against XSS attacks significantly. Due to CSP's default behaviour to block all inline JavaScript it basically breaks JSF's <f:ajax execute="input" render="output" /> functionality. This is because JSF generates lots of inline JavaScript code when using the above stated construct. Does anybody know if there is a way to use CSP in JSF based projects which make use of f:ajax

How to inject script into a page using bookmarklet if the Content Security Policy is enabled on the server?

不羁的心 提交于 2019-11-30 23:32:30
I have a bookmarklet which uses jQuery and parses some elements on the page. To use jQuery, i am creating a script tag(with src as the jQuery URL) dynamically and appending to the head tag. This works well for many sites. But, there are few sites like Facebook, for which the bookmarklet is not able to inject the external JS file into the dom.I came to know that this behaviour is because of the response header "Content Security Policy" which prohibits the inclusion of scripts from any other unauthorized domain. This is to prohibit XSS atacks. I have a genuine case to insert an external JS file

“Refused to load the script” error in chrome extension

本秂侑毒 提交于 2019-11-30 18:46:46
问题 There are a lot of questions on SO similar to this one however none of them solved my purpose. I'm creating a 'pinterest' like chrome extension. It injects script on webpage, collect images and then post it somewhere. Everything is working perfectly however when i run this on pinterest itself, it gives me this error: Refused to load the script 'https://domain_name.com/my_script.js' because it violates the following Content Security Policy directive: "default-src 'self' https:// .pinterest.com