6 ms·
> "That's what certificates are for" Could you explain that? I thought that if DNS were spoofed then people could be redirected anywhere else, no matter what th
by MrRadar 6y ago
> "That's what certificates are for" Could you explain that? I thought that if DNS were spoofed then people could be redirected anywhere else, no matter what the certificate said.
This suggests you are not very familiar with how HTTPS works. I'll give you the short version, but I'd suggest you do a lot more reading into how TLS, public key cryptography, and certificate authorities work.
Every site that wants to use HTTPS (in a way that doesn't trigger massive warnings in the client browser) has to obtain a certificate containing (among other things) the domain names that are authorized to use the certificate, a public cryptographic key, and a cryptographic signature from a certificate authority. The job of the certificate authority is to verify the person they are issuing the certificate for (by signing it) have control over the domains listed in the certificate. (Lets Encrypt's main innovation was to automate this process using the ACME protocol[1].)
When you connect to a site over HTTPS the TLS handshake includes the certificate of the site and the handshake messages are signed using the private key corresponding to the public key in the certificate. This means that the client can verify the certificate is valid for the site they are connecting to (by matching they domain they are attempting to connect to against one of the domains in the certificate's list), the server they are talking to has the private key for that certificate (because the public key is embedded in the certificate which can be used to verify the signature produced using the private key), and that the certificate itself is valid because it is authorized by a certificate authority (by using the public key from the CA's root certificate, in the "root store" of the browser/OS, to verify the signature on the certificate).
Additionally, once the handshake is completed all further traffic is encrypted and authenticated using an ephemeral key negotiated during the handshake. This means that you can trust the data coming over the wire is always coming from the correct server and has not been tampered with. (And as a side benefit it will detect any bit errors that occur during the connection, even those that are not caught by the TCP checksum, so you can be sure that e.g. large file transfers are not corrupt due to network errors.)
In order to carry out a DNS spoofing attack against a site using HTTPS (with a valid certificate issued by a recognized certificate authority), you'd either need to steal the private key associated with the certificate (in which case you've probably compromised the target site deeply enough that you don't need to spoof their DNS) or you'd need to obtain a fraudulent certificate for that site that was nevertheless issued by a recognized certificate authority. Any CA that issued an invalid certificate is supposed to immediately revoke the certificate and if they mess up like that too often they run the risk of being delisted from browser/OS root stores (this has happened in the past). Additionally, Certificate Transparency logs (where a CA maintains a public log of all certificates they have authorized) and DNS CAA records (which restrict which certificate authorities can issue certificates for a given domain name) further make this type of mis-issuance harder to carry out and easier to detect.
> How do I prevent the government of China from MITM-ing access to my web site from someone in China, using a Chinese mobile phone with certificates pre-installed and automatically by the local Chinese telco?
If the device itself is compromised there's nothing HTTPS can do. However, that scenario is outside of the scope of HTTPS. The threat model for HTTPS is bad actors in between a trusted service and a trusted client wanting to surveil or modify the traffic as it transits their networks. It is extremely effective at that.
> If I get a "free" cell phone which has a modified browser that inserted ads when viewing my web site, then from the customer's view those ads are on my site, right?
Again, if the user's device is compromised that's outside of your control and is not your fault. However, if you do not use HTTPS then anyone in between your site and the end-user's device can monitor or meddle with the connection and you do have a choice to use HTTPS to avoid that.
> Have you not seen all of the ads for systems like SecureVPN?
That still means you have to trust the VPN service and their upstream providers not to do these things. With HTTPS you are guaranteed to have protection all the way from your server to the client device.
> Can you guarantee that if I simply switch to https then the NSA could not use traffic analysis to figure out what users access from my static-pages, public-facing web site?
Obviously the NSA (and other state actors) could almost certainly figure out what any given person was looking at even if they were using HTTPS. The point of HTTPS is to increase the cost of doing such a thing from near 0 to significantly greater than 0. You can no longer just slurp up the bytes as they pass through a middle network, you have to actively catalog the site in question and perform statistical analysis to get that information.
What HTTPS will protect you against are ISPs and other middle networks monitoring your web browsing activity to sell that data to advertisers. This is a serious enough concern that the FTC asked the major US ISPs to provide information on what data they do sell about their customers[2]. And that's on top of the ad injection scenario I've already outlined.
[1] https://tools.ietf.org/html/rfc8555 https://tools.ietf.org/html/rfc8555
[2] https://arstechnica.com/tech-policy/2019/03/ftc-investigates-whether-isps-sell-your-browsing-history-and-location-data/ https://arstechnica.com/tech-policy/2019/03/ftc-investigates...
- eesmith 6y ago> When you connect to a site over HTTPS Right, but if DNS is spoofed then you haven't yet connected to the site, you've connected to another site, so none of the security your described is relevant. How does https prevent DNS spoofing? As far as I know, it doesn't. You need DNS CAA records. Which your ISP can spoof just like it can intercept your unencrypted sessions. > DNS CAA records (which restrict which certificate authorities can issue certificates for a given domain name) further make this type of mis-issuance harder to carry out and easier to detect. Earlier you talked about people who couldn't detect that ads were being injected into their browser. When you say "easier to detect", are you meaning easier to detect by people who don't recognize that their ISP injects ads? Is my readership able to recognize that their ISP is spoofing DNS for a MITM attack? How do I, right now check if my ISP is spoofing my DNS to MITM my access to my https site? 'Cause I have no clue. > However, that scenario is outside of the scope of HTTPS. Which was my point - what is the security threat I should care about? Look, I don't disagree that https has its place, and I'm fine with https on new systems. But again I ask what are the negatives? If I switch my site to https-only, how many people or devices will be negatively impacted? Can you answer that question? > The point of HTTPS is to increase the cost of doing such a thing from near 0 to significantly greater than 0. Which doesn't require https-everywhere, only https on most/significant number of places. > to sell that data to advertisers I've mentioned that that isn't a threat model that I or (I believe) my readership cares about. But let's examine it. I can ad a tracking pixel to each of my pages, right? And my readership won't notice it? And I could sell that information to advertisers? And I could put Facebook likes and other tracking methods in my pages? And you're fine with that at a technical level, since https doesn't prevent it. While it's touching that you what to ensure that I am part of the profit stream from any monetization of the contents of my site, I don't think my readership cares - I certainly don't - so it's not part of my threat model. > that the FTC asked This is the same government that allows cable monopolies and doesn't enact laws to prevent the ISPs from injecting ads into their downloads? Call my a crazy leftist, but I can't help but notice that this also strengthens the power of the big advertising companies like Google and Facebook by reducing the amount of competition, and that the FTC is looking at ISP rather than Google and Facebook abuses because the ISPs are relatively weak, making this a politically cheap action on their part.
- 6y ago