18F / https

(Deprecated) https guidance for the 18F team
Other
156 stars 16 forks source link

Enable SPDY header compression #24

Closed igrigorik closed 9 years ago

igrigorik commented 10 years ago
# SPDY header compression (0 for none, 9 for slow/heavy compression). Preferred is 6.
#
# BUT: header compression is flawed and vulnerable in SPDY versions 1 - 3.
# Disable with 0, until using a version of nginx with SPDY 4.
spdy_headers_comp 0;

CRIME can be partially defeated by preventing the use of compression, either at the client end, by the browser disabling the compression of SPDY requests, or by the website preventing the use of data compression on such transactions using the protocol negotiation features of the TLS protocol. - source

Note that CRIME is an attack on request headers. All SPDY-capable browsers disable both the TLS protocol compression and SPDY request header compression. The server can compress its response headers - that's not a problem.

FWIW, Google's front-end servers use "6" for the compression setting.

konklone commented 10 years ago

That makes total sense -- thank you for clearing this up, @igrigorik! I'll update it.

willchan commented 10 years ago

Minor clarifications:

TL;DR: in your nginx config file, you should probably use the default zlib compression level. And always be careful about reflecting user input anywhere in your web app.

konklone commented 10 years ago

And always be careful about reflecting user input anywhere in your web app.

Hmm, I feel like this is honestly too much to ask our developers to keep in mind across all of our apps. If turning off response header compression (for SPDY 1-3) means that there's no difference in our security state after adding a feature that shows user-provided input in responses, then I'd rather keep header compression turned off entirely.

konklone commented 10 years ago

All right, so between the two of you's explanation, I feel pretty good about it. I'll plan to enable response header compression, and close this issue when done.

igrigorik commented 10 years ago

@willchan @konklone good writeup by @ivanr on BREACH mitigation: https://community.qualys.com/blogs/securitylabs/2013/08/07/defending-against-the-breach-attack

Also, note that the attack applies to response bodies as well, not just headers.

konklone commented 9 years ago

Closing in favor of https://github.com/fisma-ready/nginx/issues/7 (better canonical repo than this).