11

The reason I ask whether HTTPS protects the metadata of your Internet activity from a wiretapping entity on the backbone like the NSA or not, is the following scenario:

Say I am browsing the encrypted https://xsite.com/page.html and it calls to an unencrypted javascript library at http://ysite.com/library.js or external image at http://ysite.com/image.jpg.

Does the GET request for this cross-site request pass on the URL for the encrypted page I am visiting to the unencrypted ysite.com's server, and thus, if I block the cross-site request using a browser add-on like RequestPolicy, I will prevent the NSA from knowing that my IP address visited https://xsite.com/page.html (or even the domain xsite.com entirely)?

Or, is such a privacy concern a moot point, by HTTPS not in fact hiding (to a backbone wiretapper) that your IP address visited https://xsite.com (or even /page.html), anyway?

  • 6
    It is not unusual for the domain name to be transferred in clear four times before the first encrypted message is sent. 1. DNS request. 2. DNS reply. 3. SSL client hello. 4. SSL certificate. – kasperd Jan 08 '15 at 22:17
  • Unstated is the premise that HTTPS can prevent the NSA from seeing anything at all. This premise can't necessarily be taken for granted, though. – Nathan Tuggy Jan 09 '15 at 03:38
  • ^ That's true, I didn't consider alternative methods of NSA still finding out what page you visit, so worded the question as if HTTPS was the only factor that mattered. It clearly isn't, and other issues should indeed be mentioned as a caution alongside the core issue of what HTTPS guards from backbone sniffers. –  Jan 09 '15 at 04:00
  • If the certificate uses the new NSA extensions, then no it WOULD not. This document adheres to rfc2119. – Aron Jan 09 '15 at 09:55

4 Answers4

13

Does the GET request for this cross-site request pass on the URL for the encrypted page I am visiting to the unencrypted ysite.com's server

No. ysite.com will not know the URL for the page you are visiting. xsite.com will not show up on any requests you make to ysite.com.

if I block such a cross-site request using a browser add-on like RequestPolicy, I will prevent the NSA from knowing that my IP address visited https://xsite.com/page.html (or even the domain xsite.com entirely)?

Everyone will know that you have visited xsite.com since HTTPS does not encrypt the hostname. This is because you need the hostname to set up the connection. However, it will not be possible to tell if you visited page.html or page2.html since the path will be encrypted.

However, if NSA knows that http://ysite.com/image.jpg is embedded only on page.html and you have recently made a DNS query and connected to xsite.com, they can guess that you have probably visited https://xsite.com/page.html.

Edit: The approximate length of the URL path is visible to all eavesdroppers. Thus, if xsite.com has only a few pages, it might also be possible for an attacker to guess which page you are visiting.

Additional resource on HTTP traffic analysis: Are URLs viewed during HTTPS transactions to one or more websites from a single IP distinguishable?

limbenjamin
  • 3,964
  • 50
  • 73
  • 1,281
  • So if I visit a HTTPS site (and of course, nothing certificate-wise, or otherwise is hijacked) and block all cross-site objects on it (again using RequestPolicy), the NSA won't even be able to know (outside of guessing from other undiscussed factors), what webpage it was on that website that I visited? If so that is seriously good news. –  Jan 08 '15 at 13:14
  • Assuming that you/they have perfect forward secrecy on and the NSA haven't compromised their private key or servers, yes. – pjc50 Jan 08 '15 at 13:18
  • 2
    Ah, but what about this: "with HTTPS, the URL themselves go through the tunnel, hence are encrypted. However, external observer can see the length of the encrypted data records, and thus infer the length (in bytes) of the URL". So the URL path length is determinable then? If so then the answer should be ideally updated and this factor explained, as that clearly changes things. –  Jan 08 '15 at 13:22
  • 3
    This answer ignores the fact that the question is about the NSA, which, aside from normal sniffing methods, could: have a backdoor already installed on the site, make a request for the server logs, or have acquired the site's private keys. – Digital Chris Jan 08 '15 at 14:53
  • 1
    "The length of the URL path is visible to all eavesdroppers". How? Sure, rough guesses can be made from the size of the encrypted packets, but the exact length, really, especially when you consider headers that may also vary in length? – Bruno Jan 08 '15 at 15:04
  • 4
    Are you sure that there are no Referrer-headers to xsite? (I guess this might depend on the browser.) – Paŭlo Ebermann Jan 08 '15 at 16:18
  • @Paulo From what I know, referer header is set only when navigating to a new page. I just checked and chrome does not set referer for cross site resources. – limbenjamin Jan 08 '15 at 18:14
  • 1
    @Bruno updated, thanks for pointing it out, it should be an approximate length – limbenjamin Jan 08 '15 at 18:20
  • HTTPS does encrypt the hostname. The entire stream is encrypted. This is why you can't host multiple sites using different domain names on the same IP/port combination with HTTPS like you can with HTTP. – reirab Jan 08 '15 at 21:14
  • -1 Your answer has some technical inaccuracies and you are completely disregarding traffic analysis against SSL packets which can let you determine which urls are visited based on things like the SSL packet size alone. You can see a demo at 24:45 in this youtube video: https://www.youtube.com/watch?v=N9gzxB80fxs – wireghoul Jan 08 '15 at 21:47
  • 3
  • HTTPS does encrypt the host
  • Browsers do NOT send referrer information over HTTP when the request originates from an HTTPS page
  • It's all moot because your DNS queries are not encrypted, so the host was already visible before HTTPS came into play (or could be inferred from the remote IP + a reverse DNS lookup as The Spooniest pointed out)
  • – Fabio Beltramini Jan 08 '15 at 23:09
  • 1
    @reirab but DNS queries are not secured. If I make a DNS query for google.com and it can't find the host locally, it's going to make the query externally which isn't secured. Reverse-IP is also possible in this case. –  Jan 08 '15 at 23:10
  • @Thebluefish yes, I mentioned that in my answer. – reirab Jan 08 '15 at 23:12
  • 1
    @Fabio one handshake with ServerNameIndication can and does support multiple domains on the same IP/port (not just machine); multiple handshakes without SNI can't select the cert and thus couldn't work even if anyone did them which no one does because they can't work. The only time multiple handshakes are used is to workaround broken version negotiation, see POODLE. – dave_thompson_085 Jan 08 '15 at 23:49