Summary

  • RFC 1952, published in May 1996, specifies a lossless format "compatible with the widely used GZIP utility": a cyclic redundancy check for corruption, DEFLATE for the actual squeezing, and room to swap in other methods later.
  • Its constraints read like a list written by someone who had been burned: implementable "in a manner not covered by patents", working on "a data stream (as opposed to a randomly accessible file)", and using "only an a priori bounded amount of intermediate storage".
  • The bill arrives years later. RFC 7457 catalogues CRIME, TIME and BREACH, and notes that the last of them "make[s] similar use of HTTP-level compression to decrypt secret data passed in the HTTP response".

Three requirements, and one of them was legal

A compression format has to compress. gzip also had to run inside a filter, which meant it had to work on a stream it could not rewind: no second pass, no seeking to the end, no holding the file in memory while it thought about it.

And it had to be free. In the mid-1990s compression was a patent thicket, and a format any programmer could implement without a lawyer was worth more than one that squeezed two percent harder. That is not a technical preference. It is a specification deciding, in advance, that being adoptable mattered more than being elegant.

Why the file format travelled

The design decisions that make gzip good for a pipe make it good for a network. A sender compresses as it writes; a receiver decompresses as it reads; neither needs to know the total size in advance, and neither needs the other's permission.

That is the shape of a web response. The format walked out of tape and disk and into Content-Encoding, and the negotiation around it — what the client accepts, what the server picks, what a cache may keep — became part of HTTP itself.

The cost of sharing a squeeze

Compression works by finding repetition. Put a secret and something an attacker can influence in the same response, and the length of the compressed output becomes a function of how much the two have in common.

That is the whole mechanism of the compression attacks. The attacker guesses a character, arranges for it to appear in the request, and measures how much smaller the response gets. Nobody has to read the secret. It only has to be weighed.

What the record admits

RFC 7457 does not pretend the problem is closed. It describes the attacks, notes that they exploit compression at the HTTP level, and treats mitigation as a set of trade-offs — including not compressing responses that mix secrets with reflected input.

The trade is real and unglamorous: bandwidth for a smaller attack surface. A site that compresses everything is faster and slightly more talkative.

A format that keeps paying its debts

gzip is a rare kind of standard. It succeeded because of constraints that had nothing to do with elegance: patent freedom made it deployable, streaming made it universal, and ubiquity made it a target.

Read the specification again and it looks like a design doctrine. Define the minimum that has to be common, make it checkable locally, and leave everything else to whoever is running the code. gzip did not win because a committee blessed it. It won because implementers could adopt it without asking anyone, and the format became real in running code rather than in a publication.

The lesson is not that compression is dangerous. It is that a mechanism built to remove redundancy will remove it from everything in the message — including the parts that were supposed to stay hard to guess. A shared optimisation cannot tell which bytes are cargo and which are the secret. It was never asked to.