HEIST: HTTP Encrypted Information Can Be Stolen Through TCP-Windows [pdf]
tom.vg
tom.vg
I re-read the specs to make sure [1] but isn't it on the server to alter the response to potentially nothing if the cross-origin response didn't come from source the server expects?
The paper says:
"Similar to the defense of blocking 3rd-party cookies, the web server could also block requests that are not legitimate. A popular way of doing this, is by analysing the Origin and/or Referer request headers. However, it is still possible to make requests without these two headers, preventing the web server to determine where to request originated from. As a result, this technique can not be used to prevent attacks"
On the contrary; the cross-origin access control spec (last edit in 2014) has an entire section on how to prevent malicious cross-origin requests like this, with verbiage like:
"This extension enables server-side applications to enforce limitations (e.g. returning nothing) on the cross-origin requests that they are willing to service."
If the server properly implements cross-origin access control by, say, returning nothing, the malicious cross-origin requesting script can't perform reflection attacks, and there's nothing interesting to measure with TCP windows and compression and the like.
https://chloe.re/2016/07/25/bypassing-paths-with-open-redire...
It is not standard to block cross origin requests, in fact it rare or impossible in many cases.
It is standard to block cross origin requests that perform an action, usually a POST request.
But a GET request that just gets data is normally perfectly allowed cross origin. If I click a link from Google search results to the reddit homepage, that's a cross origin GET request, but reddit has to allow it, and recognize me as logged in. Also anything that could be embedded (such as an embedded Facebook comment box) would be required to allow cross origin GET requests.
[a] allow the cross-origin request to be made, in which case the malicious website could've just made the actual request instead and obtain the body of the actual response without any of this BEAST/CRIME trickery
[b] deny the cross-origin request, in which case there is no reflected data in the response, preventing the malicious website from performing the reflected data or data-comparison attack demonstrated in the paper
(If I'm wrong, what am I missing?)
There is a preflight mechanism which the browser can use to avoid making the request at all, but that's only used for certain types of requests.
Side channels are tough.
So if the attackers JavaScript can't see a unique response it can't get the difference in size and can't execute the attack...
Here's a JSFiddle to play around with this[1], based on the code in the paper, using GitHub's account page as an example. You'll notice that the request succeeds and the fiddle has access to timing information. Inspecting the requests will show that there are no CORS headers being sent (like Origin) based on which the target could prevent the request from being served. (There's the Referer header, I suppose, but blocking the request based on that would break pretty much any third-party link to that page.)
I've tested this against various high-profile sites that include sensitive information (Google's account page, Twitter's account page, etc.), and it worked just fine on each of them. Most of them also have a parameter reflection vector (typically the full request URL is included somewhere on the page, which should be enough), so I'm pretty sure each of those sites are potentially vulnerable (though I'm not sure if calling a site vulnerable is the right approach here).
If anything, adding random garbage to the error page to approximately match the size of a normal response should make the attack useless.
Hopefully this will force browser vendors to disable that misfeature by default.
Interesting!
So the protocol has a feature for this. Everything that sends HTTP2 needs to update the list of fields not to compress, but that can be done by the sending end without any change to the receiving end.
Or, in other words: "We know that this is insecure. Maybe someone will fix it later."
[0]: https://blog.didierstevens.com/2010/03/29/escape-from-pdf/
[1]: https://thestack.com/security/2016/06/09/pdf-exploit-found-i...
Firefox is the one with the Javascript-based PDF renderer.
And it shows, hence why I always disable it.
My original point still applies though.
They used a timing side channel attack to extract data from a response when compression was enabled and user data is reflected back in a response. This attack can be done inside the browser and abuses how data is segmented when sent over tcp.
And here: http://www.lognormal.com/blog/2011/11/14/analysing-network-c...
Also I wonder if inherently varying latency of mobile and inhabited Wi-Fi networks can by itself prevent this type of attacks.
Edit: grammar.
I've said it many times and I'll say it again: keep JS off by default and enable it only for the few trusted sites that absolutely need it. Interestingly, the authors mention disabling 3rd-party cookies as a countermeasure, but not JS.
There's even an icon that appears on the right side of the address bar when Javascript is blocked, giving the option to add an exception if clicked.
http://git.suckless.org/surf/log/?h=surf-webkit2
I have modded it a bit: https://github.com/jakeogh/glide (not well tested)