BREACH Mitigation #761
Replies: 7 comments 2 replies
-
Sure. I presume you mean adding it to gzhttp. We can add a |
Beta Was this translation helpful? Give feedback.
-
BTW, The demo implementation has a bug that allows getting the response in less tries than the paper indicated. Strings are 0 terminated, so it always adds a byte of overhead when set. This means that the sizes will be:
Since there will never be an output of In fact, just observing packages it would take only about I have added it "as proposed", but I would much rather make it deterministic based on content - even that is much trickier. |
Beta Was this translation helpful? Give feedback.
-
See #762 - which has content aware padding, which I believe to be better than the proposed. You can however still use the HTB mitigation, just set the buffer size to a negative value. Oh yeah, and added it as "Comment" instead of "Name". |
Beta Was this translation helpful? Give feedback.
-
Ah, well spotted. Even though Go strings aren't null terminated, RFC 1952 specifies strings that are null terminated. The implementation in
I believe this is just a consequence of the way they're modelling the problem. Because the oracle isn't perfect, they have a series of techniques to build confidence in the validity of the character under test. These include padding the test character various ways to try to filter out noise introduced by other HTML elements that may be getting compressed as well. Huffman coding also apparently introduces a fair amount of complexity into the attack that makes the pure
Interesting idea. On first glance this certainly does seem to make the attack much more difficult. However, I have a bit of an issue with calling the |
Beta Was this translation helpful? Give feedback.
-
Thinking about this a little more...The content-aware version makes me a little squeamish, as it exposes the modular reduction of the If an attacker knows the For my part, I'd probably use the |
Beta Was this translation helpful? Give feedback.
-
Only CRC32 MOD n is used. So if n is 32, it has 31 outcomes. Also, remember the actual response is opaque to the attacker. They can inject a value, but by the nature of the attack they do not know the complete actual response. But to eliminate that suspicion, I can use SHA256 instead. It will be a bit slower, but is commonly regarded cryptographically secure. |
Beta Was this translation helpful? Give feedback.
-
Sorry, my wording above was confusing. I only meant that there are ~100 M possible inputs that yield the same
How about BLAKE2? It is faster than SHA2, and posited to be random oracle indifferentiable. |
Beta Was this translation helpful? Give feedback.
-
Hello! Wanted to open this issue to gauge the project's willingness to accept a PR to mitigate against a compression based attack on HTTP known as BREACH.
BREACH is an attack that turns the compression ratio of a HTML Response Body into an oracle for revealing secret data.
In the mitigations section, they propose a technique called "Heal the BREACH" or HTB as a way of making the attack impractical. Basically, it would involve setting the
gzip.Writer
'sHeader.Name
value to be a string of random length(modulo some upper bound, say 10 bytes). A demo implementation exists here.Beta Was this translation helpful? Give feedback.
All reactions