Live data from Hacker News

Content Security Policy

github.com

1–10 of 13 posts

Re: Content Security Policy

#3
You can also specify a CSP using a document's meta tags:

  
I'm not sure if that introduces any additional attack vectors (other than somebody modifying the document in an unencrypted connection) but it's useful for when hosting statically.

EDIT: updated to mimic example in post

Re: Content Security Policy

#5
post #3

You can also specify a CSP using a document's meta tags: I'm not sure if that introduces any additional attack vectors (other than somebody modifying the document in an unencrypted connection) but it's useful for when hosting statically. EDIT: updated to mimic example in post

> it's useful for when hosting statically.

You can configure your webserver to add those headers, when hosting statically. There is no need to include it in all your pages.

nginx: add_header Content-Security-Policy "...";

Re: Content Security Policy

#6
post #5
post #3

You can also specify a CSP using a document's meta tags: I'm not sure if that introduces any additional attack vectors (other than somebody modifying the document in an unencrypted connection) but it's useful for when hosting statically. EDIT: updated to mimic example in post

> it's useful for when hosting statically. You can configure your webserver to add those headers, when hosting statically. There is no need to include it in all your pages. nginx: add_header Content-Security-Policy "...";

If your site is a simple static blog or whatever, there probably is no XSS vector. So you probably don't need CSP.

Re: Content Security Policy

#7
post #2

This entire post is like a "why CSP is broken in the real world", yet they're going ahead with deploying it?

Their feedback is very useful to us as we iterate on the specification and implementation of CSP. (Disclosure: I'm an editor of the CSP specification.)

Re: Content Security Policy

#8
post #7
post #2

This entire post is like a "why CSP is broken in the real world", yet they're going ahead with deploying it?

Their feedback is very useful to us as we iterate on the specification and implementation of CSP. (Disclosure: I'm an editor of the CSP specification.)

Thanks for your work! I'm a fan of CSP's goals.

Re: Content Security Policy

#10
Its great to see a large site like GitHub start work on deploying CSP. I don't know how many times I've had to argue with people about bad practices like inline event handlers. With CSP there's a way for a site to prevent them from being used.
Post reply on HN