You are completely wrong. The BREACH attack showed that you can be vulnerable to a compression oracle by merely compressing response bodies: http://breachattack.com/
> For the love of god, keep using compression with your websites, whether HTTP/1.x, TLS + HTTP/1.x, or HTTP/2
You can continue compressing files such as CSS that don't reflect any attacker-controlled content, but compression of dynamic HTML pages is likely to be insecure.
In practice, there isn't a way I know of to mark the relevant parts of the response body so that the compression, which is usually done as a separate post-processing step, will know to avoid compressing these parts of the stream. And it would be very fragile; forgetting to mark a secret as "do not compress this" would work perfectly fine but reintroduce the vulnerability.
So only compress when sending over the wire?
Encrypted data is supposed to look random, and as a consequence, it tends to compress very poorly.
Is my server vulnerable to this?
I personally use SSL on my personal site just because I like the idea that readers can be sure the content is what I've sent, rather than because the information is private / sensitive. So I'm not personally concerned because this doesn't allow anyone to MITM the connection, just read it.
Adding data of random length will make the attack more difficult, but won't defeat it entirely. This is called length hiding.
See http://breachattack.com/ for a more thorough explanation by smarter people.
A counter-measure then would be to scramble the user input in the page with a random key, and include this key into the page for de-scrambling using JavaScript. It will still efficiently compress the parts of the page which are not user-controlled.
breachattack.com suggests masking the secret with a per-request random key, but masking the user input would work too.
No thank you.
This is a patently wrong statement in an otherwise good article.
There are no known security vulnerabilities with HTTP/1.x's style of compression That's because HTTP/1.x only supports compressing response bodies. During SPDY development, the same compression algorithms used for compressing HTTP responses (gzip/deflate) were applied to compress request and response headers. This is what lead to the CRIME vulnerability. The solution was to still use compression, but use a different compression scheme, HPACK, which (glossing over a ton of technical details) allows compression while avoid CRIME because it "[uses] separate compression dictionaries are used for each source of data." HTTP/2 uses HPACK.
Use of TLS compression is not recommended, but that has always been a performance best practice, since TLS compression is not context aware.
For the love of god, keep using compression with your websites, whether HTTP/1.x, TLS + HTTP/1.x, or HTTP/2