3 ms·
When the user grants permission to a site, how does that permission work? By domain or resolved IP address? If it's by domain and there's no HPKP for it (and IP
by theandrewbailey 11y ago
When the user grants permission to a site, how does that permission work? By domain or resolved IP address? If it's by domain and there's no HPKP for it (and IP not cached), the MITM can send a malicious IP through DNS for any domain. The server at malicious IP can fake being whatever domain and the attack will work.
- JoshTriplett 11y agoBy domain. However, with a requirement for HTTPS, it doesn't matter if MITM hijacks that domain and points it at another IP, because the server on that IP can't present a valid certificate for that domain, so it won't load at all. Pinning makes that even more secure, but even without pinning, requiring HTTPS raises the bar from a simple MITM to obtaining a fraudulent certificate from a trusted certificate authority (risking a blacklist of that CA in all browsers).
- konklone 11y agoI think that instead of HPKP, the parent poster meant to refer to HSTS. If the attacker MITMs an HTTPS request, then they have to provide a forged certificate (whether HSTS is set or not). If the attacker MITMs an HTTP request which would have normally been redirected (e.g. typing "facebook.com" into the URL bar), then HSTS is required. Without it, no forged certificate required. HTTPS and HSTS should have just been the baseline the web shipped with, but the web shipped before people thought about these things, and arguably before encryption was stable/secure/fast enough to be practical for the whole web. I'm very happy that the federal HTTPS-policy includes an HSTS requirement for federal agencies: https://https.cio.gov/ https://https.cio.gov/
- JoshTriplett 11y agoVery good point. However, even if the attacker MITMs an HTTP request that would have been redirected, for a site that didn't use HSTS, they won't get cookies marked "secure", and they won't get permissions that require HTTPS. So the browser mechanism limiting those permissions to HTTPS still works even in that case, though the user and site both have other problems.
- konklone 11y agoThey won't get secure cookies [for the site they're attacking], though they could plausibly redirect the user to a similar-looking HTTPS domain under their control and get permissions requiring a secure origin.
- JoshTriplett 11y agoTrue, but they won't get permissions that the user grants on a site-by-site basis, which also means the attack can't silently happen in the background.