<div dir="ltr">Hi Tim,<div><br></div><div>Its interesting to know that this issue has been taken into account into the TOR protocol itself. Clock skew and similar attacks are a serious issue for anonymous services. </div><div><br></div><div>To provide additional information, I have found that only Microsoft Windows Operating Systems are providing local times instead of universal times in the MTIME field of the gzip header. The gzip specification states that only universal times should be used, as you can see here:</div><div><br></div><div><a href="http://www.zlib.org/rfc-gzip.html#header-trailer">http://www.zlib.org/rfc-gzip.html#header-trailer</a><br></div><div><br></div><div>However, for some reason, microsoft windows or some gzip implementation in some popular web server for Microsoft Windows is not respecting the specification and is using local times instead of universal times.</div><div><br></div><div>Of course, any implementation leaking time is susceptible to clock skew attacks, even if they use universal time instead of local time. But those implementations wrongly sending local times instead of universal times are leaking a lot more information (i.e. the time zone where the service runs).</div><div><br></div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-22 0:22 GMT+01:00 Tim Wilson-Brown - teor <span dir="ltr"><<a href="mailto:teor2345@gmail.com" target="_blank">teor2345@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On 22 Feb 2016, at 09:52, Jose Carlos Norte <<a href="mailto:jcarlos.norte@gmail.com" target="_blank">jcarlos.norte@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div style="margin:0px 0px 0.357143em;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif">The gzip compression format used by HTTP if accepted by both server and client, under certain configurations, provides the date of the server that compressed the HTTP Response. This information can be used by a third party to know the time zone where the onion site is hosted.</div><div style="margin:0.357143em 0px;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif">I have written a more in depth explanation about the topic at:</div><div style="margin:0.357143em 0px;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif"><a href="http://jcarlosnorte.com/security/2016/02/21/date-leak-gzip-tor.html" style="text-decoration:none;color:rgb(0,121,211);margin:0px" target="_blank">http://jcarlosnorte.com/security/2016/02/21/date-leak-gzip-tor.html</a></div><div style="margin:0.357143em 0px;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif">A proof of concept is included, to check if your service is leaking this information through the gzip headers of a compressed HTTP Response.</div><div style="margin:0.357143em 0px;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif">I have decided to share this because is not an obvious miss-configuration that could lead to the leak of information about the physical position of your hidden service. Be careful.</div><div style="margin:0.357143em 0px 0px;padding:0px;font-size:14px;line-height:1.42857em;font-family:verdana,arial,helvetica,sans-serif">Of course, just knowing the timezone of your hidden service server is not enough to know your identity, or your exact server location, but combined with another leaks or other pieces of information, could be dangerous.</div></div></div></blockquote><br></div></div></div><div>Thanks for this report, Jose Carlos.</div><div><br></div><div>For completeness, tor itself does not suffer from this issue, even though it uses gzip compression internally to compress directory documents.</div><div><br></div><div>Hidden services and clients do not produce or recompress directory documents, so they could never be affected.</div><div><br></div><div>And tor authorities use deflateInit2 to initialise compression for votes and consensuses, which zeroes the gzip header.</div><div><br></div><div>From the deflateInit2 documentation in zlib.h:</div><div><br></div><div>    "windowBits can also be greater than 15 for optional gzip encoding.  Add<br>   16 to windowBits to write a simple gzip header and trailer around the<br>   compressed data instead of a zlib wrapper.  The gzip header will have no<br>   file name, no extra data, no comment, no modification time (set to zero), no<br>   header crc, and the operating system will be set to 255 (unknown).  If a<br>   gzip stream is being written, strm->adler is a crc32 instead of an adler32."</div><div><br></div><div><br></div><div>Tim</div><div><br></div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="text-align:start;text-indent:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-align:start;text-indent:0px;word-wrap:break-word">Tim Wilson-Brown (teor)</div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-align:start;text-indent:0px;word-wrap:break-word"><br></div><div style="text-align:start;text-indent:0px;word-wrap:break-word">teor2345 at gmail dot com<br>PGP 968F094B<br><br>teor at blah dot im<br>OTR CAD08081 9755866D 89E2A06F E3558B7F B5A9D14F</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<br></div><br>_______________________________________________<br>
tor-onions mailing list<br>
<a href="mailto:tor-onions@lists.torproject.org">tor-onions@lists.torproject.org</a><br>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-onions" rel="noreferrer" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-onions</a><br>
<br></blockquote></div><br></div></div></div>