News for hackers. Stuff that matters.
Re:HTTP Security headers you should be using by nodesocket on Thursday January 23, 2014 @11:21AM (#7109082)
Can you specify domain wildcards in Content-Security-Policy script-src? For example:

    Content-Security-Policy: script-src 'self' *.somedomain.com
Also, while it looks great, usually its very difficult to integrate this header, without breaking existing JS functionality. For example, if you set this header, inline JavaScript will not be executed, this includes added event methods directly on DOM elements. Also eval() and writing setTimeout() and setInterval() like:

    window.setInterval("alert('hi')", 10);
Are forbidden from executing as well. Finally, using 3rd party libraries (Mixpanel, Google hosted libraries, Intercom.io) becomes nearly impossible without explicitly whitelisting domains in the header (a huge hassle to maintain).
Re:HTTP Security headers you should be using by yeukhon on Thursday January 23, 2014 @12:23PM (#7109529)
Can you specify domain wildcards in Content-Security-Policy script-src?

Yes. You may. http://www.w3.org/TR/CSP/#source-list See the host ABNF grammar.

while it looks great, usually its very difficult to integrate this header, without breaking existing JS functionalit

I haven't read much about 1.1 but as far as I know nounce and hash added to 1.1 is to deal with whitelisting inline scripts.

Please see http://w3c.github.io/webappsec/specs/content-security-policy...

Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=855326

https://bugs.webkit.org/show_bug.cgi?id=89577

http://lists.w3.org/Archives/Public/public-webappsec/2013Jun...

Also, if you are interested in client-side security, Mike West (from Google, one of the editors of CSP) has given a talk recently. http://www.parleys.com/play/529bee0be4b039ad2298ca0b

edit remember that the support of 1.1 is relatively low and incomplete as the webappsec group is voting on whether moving it to WD (working draft or not). So for cross-browser compatibility, you are still better off with 1.0 which is at this point very stable in major browsers.

Re:HTTP Security headers you should be using by michaelmior on Thursday January 23, 2014 @02:41PM (#7110625)
Awesome. Thanks for the note about version 1.1 of the standard. Wasn't aware nonces and hashing were added.
Re:HTTP Security headers you should be using by falcolas on Thursday January 23, 2014 @12:11PM (#7109436)
The inline restriction burned us as well when we tried to implement this.

The solution is, of course, to do everything in separate script files, but it's not a trivial migration effort.

Re:HTTP Security headers you should be using by UnoriginalGuy on Thursday January 23, 2014 @01:51PM (#7110229)
I definitely see it as being the biggest roadblock for most sites. The report-only mode is useful for getting a work list of what needs fixing.

Plus long term moving inline JS to separate files must improve maintainability, version control, and also means your caching might work more effectively. So there is a little gain for the pain (aside from just the content policy).

Re:HTTP Security headers you should be using by kyrra on Thursday January 23, 2014 @01:04PM (#7109852)
It looks like you can enable inline and eval stuff.

    Content-Security-Policy: script-src 'self' 'unsafe-eval' 'unsafe-inline'
Re:HTTP Security headers you should be using by amenod on Thursday January 23, 2014 @02:28PM (#7110538)
But in that case you don't benefit much from it... (afaik)
Re:HTTP Security headers you should be using by al2o3cr on Thursday January 23, 2014 @04:16PM (#7111262)
"For example, if you set this header, inline JavaScript will not be executed, this includes added event methods directly on DOM elements. Also eval() and writing setTimeout() and setInterval() like: window.setInterval("alert('hi')", 10);"

Sounds like a feature, not a bug.

Re:HTTP Security headers you should be using by eCa on Thursday January 23, 2014 @12:19PM (#7109504)
> Can you specify domain wildcards in Content-Security-Policy script-src?

Yes: http://www.html5rocks.com/en/tutorials/security/content-secu...

Re:HTTP Security headers you should be using by treve on Thursday January 23, 2014 @03:21PM (#7110933)
While it may be hard to migrate existing applications, since about 2 year I've started building all applications with externalized javascript.

So sticking to that rule for new stuff can greatly increase security.

Re:HTTP Security headers you should be using by theboss on Friday January 24, 2014 @08:31AM (#7114792)
it isn't that difficult to white list a few domains.. It's a grand total of 1-5 lines of code that contains a string you can change...

CSP is super valuable and it's worth the few extra lines

Re:HTTP Security headers you should be using by darrhiggs on Thursday January 23, 2014 @12:22PM (#7109520)
To answer your first question: yes[1]

[1] http://www.w3.org/TR/CSP/#matching