Closed drwetter closed 3 years ago
Kudos to Ben, ho pointed me yesterday to the double headers
Thank you for pointing out the errors. Much of the above has been updated.
That reminds me, as nobody is a web admin, any help formulating a decent CSP for a static website that allows leaders to include images from various sources, add video from various sources, implement all sorts of import tooling and bring in various twitter/facebook/etc media feeds all while keeping things decently locked down would be helpful too.
Hi @hblankenship
Content-Security-Policy: default-src 'self' https://api.github.com https://*.githubusercontent.com https://*.google-analytics.com https://owaspadmin.azurewebsites.net https://*.twimg.com https://platform.twitter.com https://www.youtube.com; frame-ancestors 'self'; frame-src https://*.vuejs.org https://*.stripe.com https://*.wufoo.com https://*.sched.com https://*.google.com https://*.twitter.com https://www.youtube.com https://w.soundcloud.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cse.google.com https://*.vuejs.org https://*.stripe.com https://*.wufoo.com https://*.youtube.com https://*.meetup.com https://*.sched.com https://*.google-analytics.com https://unpkg.com https://buttons.github.io https://www.google.com https://*.gstatic.com https://*.twitter.com https://*.twimg.com; style-src 'self' 'unsafe-inline' https://www.google.com fonts.googleapis.com https://platform.twitter.com https://*.twimg.com; font-src 'self' fonts.gstatic.com; manifest-src 'self'https://pay.google.com; img-src 'self' data: www.w3.org https://licensebuttons.net https://img.shields.io https://*.twitter.com https://github.githubassets.com https://*.twimg.com https://platform.twitter.com https://*.githubusercontent.com https://*.vercel.app https://*.cloudfront.net https://*.coreinfrastructure.org https://*.securityknowledgeframework.org https://badges.gitter.im https://travis-ci.org https://api.travis-ci.org https://s3.amazonaws.com https://snyk.io https://coveralls.io https://requires.io https://github.com https://*.googleapis.com https://*.google.com https://*.gstatic.com
Do we have really that much third party content?? 😲 Then I think we might do something wrong in the first place. In general you can't catch every thing coming from third parties by CSP. This is a fundamental security question, E.g. lots of the google / twitter hosts are known for using JSONP endpoints. Don't know whether a user of Google or Twitter can control them. If they do: it affects our site. Also: I don't know whether through github PRs the unsafe-inline might hit us.
Maintainability is another general remark: If we have that many host and I suppose it'll change more or less often (enough) you should ask yourself who's going to maintain that?
If you want to maintain that: add object-src: none;
What is the point with ACAO?
On that note: having google-analytics.com in the list of allowed script sources (notwithstanding the 'unsafe-inline'
), you open yourself up to arbitrary execution as well. All script from Google Tag Manager (to which you can upload what you want) are also reachable via google-analytics.com. As an example, see https://www.google-analytics.com/gtm/js?id=GTM-PTPBVMC (you'll note that this includes another script, coming from persistent.kittenpics.org, but that could be just arbitrary other code).
For the ACAO: , this is a bit meaningless, but also not really dangerous. It's an entirely public page and even if you can login, ACAO: defaults securely (i.e., credentials requests are not allowed).
https://www.google-analytics.com/gtm/js?id=GTM-PTPBVMC : w00t! "\u003Cscript src=\"https:\/\/persistent.kittenpics.org\"\u003E\u003C\/script\u003E\n\u003Ch1\u003EAwesome stuff!\u003C\/h1\u003E
https://*.githubusercontent.com
includes e.g. https://raw.githubusercontent.com
which is cool for attackers. (kudos to hanno)
You're right wrt ACAO. My humble guess was that there's a misconception here with ACAO: *
here like I once in a while encounter like "if you don't use that third parties cannot read PDFs / images / other objects from your web site". Of course it does not a harm by itself but it's half way there when in addition e.g. "Access-Control-Allow-Credentials: true" is being used at some dangerous point some time. So what I suggest is to understand is why ACAO is there. Often it just can be removed which I suppose is the case here.
For ACAO: * with ACAC: true, there is no security issue. CORS defaults securely, i.e., you have to have an explicit origin allowed when using ACAC: true (see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Note_3).
Ah, thanks.
Nowadays there are some errors in the CSP of the home page.
Below CSP header includes them and results in no errors. I supposed @hblankenship is the one that can modify this, I didn't find this on any repo.
Content-Security-Policy: default-src 'self' https://api.github.com https://*.githubusercontent.com https://*.google-analytics.com https://owaspadmin.azurewebsites.net https://*.twimg.com https://platform.twitter.com https://www.youtube.com https://*.doubleclick.net; frame-ancestors 'self'; frame-src https://*.vuejs.org https://*.stripe.com https://*.wufoo.com https://*.sched.com https://*.google.com https://*.twitter.com https://www.youtube.com https://w.soundcloud.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.googleapis.com https://app.diagrams.net https://cdnjs.cloudflare.com https://cse.google.com https://*.vuejs.org https://*.stripe.com https://*.wufoo.com https://*.youtube.com https://*.meetup.com https://*.sched.com https://*.google-analytics.com https://unpkg.com https://buttons.github.io https://www.google.com https://*.gstatic.com https://*.twitter.com https://*.twimg.com; style-src 'self' 'unsafe-inline' https://*.gstatic.com https://cdnjs.cloudflare.com https://www.google.com https://fonts.googleapis.com https://platform.twitter.com https://*.twimg.com data:; font-src 'self' fonts.gstatic.com; manifest-src 'self' https://pay.google.com; img-src 'self' data: www.w3.org https://licensebuttons.net https://img.shields.io https://*.twitter.com https://github.githubassets.com https://*.twimg.com https://platform.twitter.com https://*.githubusercontent.com https://*.vercel.app https://*.cloudfront.net https://*.coreinfrastructure.org https://*.securityknowledgeframework.org https://badges.gitter.im https://travis-ci.org https://api.travis-ci.org https://s3.amazonaws.com https://snyk.io https://coveralls.io https://requires.io https://github.com https://*.googleapis.com https://*.google.com https://*.gstatic.com
With this fixed I thinks this issue can be closed
1) `object-src: none; `` or any other source is missing.
2) I believe maintaining the list doesn't work, realistically. At least if there's no central instance within OWASP which knows where all the content comes from and can notify the maintainer of any changes needed.
Allow me a remark: Still scratching my head why we have so many third parties delivering content. That is crazy!
I made the additions per Martin. Regarding the so many third parties issue - it is either because the foundation utilizes these third parties in the website (vue.js, for instance) or various projects/chapters were already using them and we didn't want to break their pages.
It doesn't shed a good light on OWASP.
Permissions-Policy: geolocation=(self 'https://example.com');
: was that a copy & paste thing from MDN??ACAO *
, why ?What do we do with owaspadmin.azurewebsites.net ? --> Your Functions 3.0 app is up and running Azure Functions is an event-based serverless compute experience to accelerate your development.
compute experience, really?
owaspadmin.azurewebsites.net doesn't redirect to https